代码修改后的版本,全部提交

This commit is contained in:
ss001
2026-02-07 15:48:27 +08:00
parent cccbaa37c9
commit c2cda58c65
15604 changed files with 2455502 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class ImageRecord : AbstractModel
{
/// <summary>
/// 图片翻译结果
/// </summary>
[JsonProperty("Value")]
public ItemValue[] Value{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamArrayObj(map, prefix + "Value.", this.Value);
}
}
}

View File

@@ -0,0 +1,78 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class ImageTranslateRequest : AbstractModel
{
/// <summary>
/// 唯一id返回时原样返回
/// </summary>
[JsonProperty("SessionUuid")]
public string SessionUuid{ get; set; }
/// <summary>
/// doc:文档扫描
/// </summary>
[JsonProperty("Scene")]
public string Scene{ get; set; }
/// <summary>
/// 图片数据的Base64字符串图片大小上限为4M建议对源图片进行一定程度压缩
/// </summary>
[JsonProperty("Data")]
public string Data{ get; set; }
/// <summary>
/// 源语言,支持语言列表<li> zh : 中文 </li> <li> en : 英文 </li>
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 目标语言,支持语言列表<li> zh : 中文 </li> <li> en : 英文 </li>
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// 项目ID可以根据控制台-账号中心-项目管理中的配置填写如无配置请填写默认项目ID:0
/// </summary>
[JsonProperty("ProjectId")]
public long? ProjectId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SessionUuid", this.SessionUuid);
this.SetParamSimple(map, prefix + "Scene", this.Scene);
this.SetParamSimple(map, prefix + "Data", this.Data);
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId);
}
}
}

View File

@@ -0,0 +1,71 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class ImageTranslateResponse : AbstractModel
{
/// <summary>
/// 请求的SessionUuid返回
/// </summary>
[JsonProperty("SessionUuid")]
public string SessionUuid{ get; set; }
/// <summary>
/// 源语言
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 目标语言
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// 图片翻译结果,翻译结果按识别的文本每一行独立翻译,后续会推出按段落划分并翻译的版本
/// </summary>
[JsonProperty("ImageRecord")]
public ImageRecord ImageRecord{ get; set; }
/// <summary>
/// 唯一请求 ID每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
/// </summary>
[JsonProperty("RequestId")]
public string RequestId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SessionUuid", this.SessionUuid);
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamObj(map, prefix + "ImageRecord.", this.ImageRecord);
this.SetParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
}

View File

@@ -0,0 +1,78 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class ItemValue : AbstractModel
{
/// <summary>
/// 识别出的源文
/// </summary>
[JsonProperty("SourceText")]
public string SourceText{ get; set; }
/// <summary>
/// 翻译后的译文
/// </summary>
[JsonProperty("TargetText")]
public string TargetText{ get; set; }
/// <summary>
/// X坐标
/// </summary>
[JsonProperty("X")]
public long? X{ get; set; }
/// <summary>
/// Y坐标
/// </summary>
[JsonProperty("Y")]
public long? Y{ get; set; }
/// <summary>
/// 宽度
/// </summary>
[JsonProperty("W")]
public long? W{ get; set; }
/// <summary>
/// 高度
/// </summary>
[JsonProperty("H")]
public long? H{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SourceText", this.SourceText);
this.SetParamSimple(map, prefix + "TargetText", this.TargetText);
this.SetParamSimple(map, prefix + "X", this.X);
this.SetParamSimple(map, prefix + "Y", this.Y);
this.SetParamSimple(map, prefix + "W", this.W);
this.SetParamSimple(map, prefix + "H", this.H);
}
}
}

View File

@@ -0,0 +1,50 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class LanguageDetectRequest : AbstractModel
{
/// <summary>
/// 待识别的文本文本统一使用utf-8格式编码非utf-8格式编码字符会翻译失败。单次请求的文本长度需要低于2000。
/// </summary>
[JsonProperty("Text")]
public string Text{ get; set; }
/// <summary>
/// 项目ID可以根据控制台-账号中心-项目管理中的配置填写如无配置请填写默认项目ID:0
/// </summary>
[JsonProperty("ProjectId")]
public long? ProjectId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "Text", this.Text);
this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId);
}
}
}

View File

@@ -0,0 +1,51 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class LanguageDetectResponse : AbstractModel
{
/// <summary>
/// 识别出的语言种类,参考语言列表
/// <li> zh : 中文 </li> <li> en : 英文 </li><li> jp : 日语 </li> <li> kr : 韩语 </li><li> de : 德语 </li><li> fr : 法语 </li><li> es : 西班牙文 </li> <li> it : 意大利文 </li><li> tr : 土耳其文 </li><li> ru : 俄文 </li><li> pt : 葡萄牙文 </li><li> vi : 越南文 </li><li> id : 印度尼西亚文 </li><li> ms : 马来西亚文 </li><li> th : 泰文 </li>
/// </summary>
[JsonProperty("Lang")]
public string Lang{ get; set; }
/// <summary>
/// 唯一请求 ID每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
/// </summary>
[JsonProperty("RequestId")]
public string RequestId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "Lang", this.Lang);
this.SetParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
}

View File

@@ -0,0 +1,99 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class SpeechTranslateRequest : AbstractModel
{
/// <summary>
/// 一段完整的语音对应一个SessionUuid
/// </summary>
[JsonProperty("SessionUuid")]
public string SessionUuid{ get; set; }
/// <summary>
/// 音频中的语言类型,支持语言列表<li> zh : 中文 </li> <li> en : 英文 </li>
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 翻译目标语⾔言类型 ,支持的语言列表<li> zh : 中文 </li> <li> en : 英文 </li>
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// pcm : 146 speex : 16779154 mp3 : 83886080
/// </summary>
[JsonProperty("AudioFormat")]
public long? AudioFormat{ get; set; }
/// <summary>
/// 语音分片的序号从0开始
/// </summary>
[JsonProperty("Seq")]
public long? Seq{ get; set; }
/// <summary>
/// 是否最后一片语音分片0-否1-是
/// </summary>
[JsonProperty("IsEnd")]
public long? IsEnd{ get; set; }
/// <summary>
/// 语音分片内容的base64字符串音频内容应含有效并可识别的文本
/// </summary>
[JsonProperty("Data")]
public string Data{ get; set; }
/// <summary>
/// 项目ID可以根据控制台-账号中心-项目管理中的配置填写如无配置请填写默认项目ID:0
/// </summary>
[JsonProperty("ProjectId")]
public long? ProjectId{ get; set; }
/// <summary>
/// 识别模式,该参数已废弃
/// </summary>
[JsonProperty("Mode")]
public string Mode{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SessionUuid", this.SessionUuid);
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamSimple(map, prefix + "AudioFormat", this.AudioFormat);
this.SetParamSimple(map, prefix + "Seq", this.Seq);
this.SetParamSimple(map, prefix + "IsEnd", this.IsEnd);
this.SetParamSimple(map, prefix + "Data", this.Data);
this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId);
this.SetParamSimple(map, prefix + "Mode", this.Mode);
}
}
}

View File

@@ -0,0 +1,99 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class SpeechTranslateResponse : AbstractModel
{
/// <summary>
/// 请求的SessionUuid直接返回
/// </summary>
[JsonProperty("SessionUuid")]
public string SessionUuid{ get; set; }
/// <summary>
/// 语音识别状态 1-进行中 0-完成
/// </summary>
[JsonProperty("RecognizeStatus")]
public long? RecognizeStatus{ get; set; }
/// <summary>
/// 识别出的原文
/// </summary>
[JsonProperty("SourceText")]
public string SourceText{ get; set; }
/// <summary>
/// 翻译出的译文
/// </summary>
[JsonProperty("TargetText")]
public string TargetText{ get; set; }
/// <summary>
/// 第几个语音分片
/// </summary>
[JsonProperty("Seq")]
public long? Seq{ get; set; }
/// <summary>
/// 原语言
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 目标语言
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// 当请求的Mode参数填写bvad是启动VadSeq。此时Seq会被设置为后台vad静音检测后的新序号而VadSeq代表客户端原始Seq值
/// </summary>
[JsonProperty("VadSeq")]
public long? VadSeq{ get; set; }
/// <summary>
/// 唯一请求 ID每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
/// </summary>
[JsonProperty("RequestId")]
public string RequestId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SessionUuid", this.SessionUuid);
this.SetParamSimple(map, prefix + "RecognizeStatus", this.RecognizeStatus);
this.SetParamSimple(map, prefix + "SourceText", this.SourceText);
this.SetParamSimple(map, prefix + "TargetText", this.TargetText);
this.SetParamSimple(map, prefix + "Seq", this.Seq);
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamSimple(map, prefix + "VadSeq", this.VadSeq);
this.SetParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
}

View File

@@ -0,0 +1,102 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class TextTranslateBatchRequest : AbstractModel
{
/// <summary>
/// 源语言,支持:
/// auto自动识别识别为一种语言
/// zh简体中文
/// zh-TW繁体中文
/// en英语
/// ja日语
/// ko韩语
/// fr法语
/// es西班牙语
/// it意大利语
/// de德语
/// tr土耳其语
/// ru俄语
/// pt葡萄牙语
/// vi越南语
/// id印尼语
/// th泰语
/// ms马来西亚语
/// ar阿拉伯语
/// hi印地语
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 目标语言,各源语言的目标语言支持列表如下
///
/// <li> zh简体中文en英语、ja日语、ko韩语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语、vi越南语、id印尼语、th泰语、ms马来语</li>
/// <li>zh-TW繁体中文en英语、ja日语、ko韩语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语、vi越南语、id印尼语、th泰语、ms马来语</li>
/// <li>en英语zh中文、ja日语、ko韩语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语、vi越南语、id印尼语、th泰语、ms马来语、ar阿拉伯语、hi印地语</li>
/// <li>ja日语zh中文、en英语、ko韩语</li>
/// <li>ko韩语zh中文、en英语、ja日语</li>
/// <li>fr法语zh中文、en英语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>es西班牙语zh中文、en英语、fr法语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>it意大利语zh中文、en英语、fr法语、es西班牙语、de德语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>de德语zh中文、en英语、fr法语、es西班牙语、it意大利语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>tr土耳其语zh中文、en英语、fr法语、es西班牙语、it意大利语、de德语、ru俄语、pt葡萄牙语</li>
/// <li>ru俄语zh中文、en英语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、pt葡萄牙语</li>
/// <li>pt葡萄牙语zh中文、en英语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语</li>
/// <li>vi越南语zh中文、en英语</li>
/// <li>id印尼语zh中文、en英语</li>
/// <li>th泰语zh中文、en英语</li>
/// <li>ms马来语zh中文、en英语</li>
/// <li>ar阿拉伯语en英语</li>
/// <li>hi印地语en英语</li>
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// 项目ID可以根据控制台-账号中心-项目管理中的配置填写如无配置请填写默认项目ID:0
/// </summary>
[JsonProperty("ProjectId")]
public long? ProjectId{ get; set; }
/// <summary>
/// 待翻译的文本列表批量接口可以以数组方式在一次请求中填写多个待翻译文本。文本统一使用utf-8格式编码非utf-8格式编码字符会翻译失败请传入有效文本html标记等非常规翻译文本可能会翻译失败。单次请求的文本长度总和需要低于2000。
/// </summary>
[JsonProperty("SourceTextList")]
public string[] SourceTextList{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId);
this.SetParamArraySimple(map, prefix + "SourceTextList.", this.SourceTextList);
}
}
}

View File

@@ -0,0 +1,64 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class TextTranslateBatchResponse : AbstractModel
{
/// <summary>
/// 源语言详见入参Target
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 目标语言详见入参Target
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// 翻译后的文本列表
/// </summary>
[JsonProperty("TargetTextList")]
public string[] TargetTextList{ get; set; }
/// <summary>
/// 唯一请求 ID每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
/// </summary>
[JsonProperty("RequestId")]
public string RequestId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamArraySimple(map, prefix + "TargetTextList.", this.TargetTextList);
this.SetParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
}

View File

@@ -0,0 +1,109 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class TextTranslateRequest : AbstractModel
{
/// <summary>
/// 待翻译的文本文本统一使用utf-8格式编码非utf-8格式编码字符会翻译失败请传入有效文本html标记等非常规翻译文本可能会翻译失败。单次请求的文本长度需要低于2000。
/// </summary>
[JsonProperty("SourceText")]
public string SourceText{ get; set; }
/// <summary>
/// 源语言,支持:
/// auto自动识别识别为一种语言
/// zh简体中文
/// zh-TW繁体中文
/// en英语
/// ja日语
/// ko韩语
/// fr法语
/// es西班牙语
/// it意大利语
/// de德语
/// tr土耳其语
/// ru俄语
/// pt葡萄牙语
/// vi越南语
/// id印尼语
/// th泰语
/// ms马来西亚语
/// ar阿拉伯语
/// hi印地语
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 目标语言,各源语言的目标语言支持列表如下
///
/// <li> zh简体中文en英语、ja日语、ko韩语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语、vi越南语、id印尼语、th泰语、ms马来语</li>
/// <li>zh-TW繁体中文en英语、ja日语、ko韩语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语、vi越南语、id印尼语、th泰语、ms马来语</li>
/// <li>en英语zh中文、ja日语、ko韩语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语、vi越南语、id印尼语、th泰语、ms马来语、ar阿拉伯语、hi印地语</li>
/// <li>ja日语zh中文、en英语、ko韩语</li>
/// <li>ko韩语zh中文、en英语、ja日语</li>
/// <li>fr法语zh中文、en英语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>es西班牙语zh中文、en英语、fr法语、it意大利语、de德语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>it意大利语zh中文、en英语、fr法语、es西班牙语、de德语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>de德语zh中文、en英语、fr法语、es西班牙语、it意大利语、tr土耳其语、ru俄语、pt葡萄牙语</li>
/// <li>tr土耳其语zh中文、en英语、fr法语、es西班牙语、it意大利语、de德语、ru俄语、pt葡萄牙语</li>
/// <li>ru俄语zh中文、en英语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、pt葡萄牙语</li>
/// <li>pt葡萄牙语zh中文、en英语、fr法语、es西班牙语、it意大利语、de德语、tr土耳其语、ru俄语</li>
/// <li>vi越南语zh中文、en英语</li>
/// <li>id印尼语zh中文、en英语</li>
/// <li>th泰语zh中文、en英语</li>
/// <li>ms马来语zh中文、en英语</li>
/// <li>ar阿拉伯语en英语</li>
/// <li>hi印地语en英语</li>
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// 项目ID可以根据控制台-账号中心-项目管理中的配置填写如无配置请填写默认项目ID:0
/// </summary>
[JsonProperty("ProjectId")]
public long? ProjectId{ get; set; }
/// <summary>
/// 用来标记不希望被翻译的文本内容,如句子中的特殊符号、人名、地名等;每次请求只支持配置一个不被翻译的单词;仅支持配置人名、地名等名词,不要配置动词或短语,否则会影响翻译结果。
/// </summary>
[JsonProperty("UntranslatedText")]
public string UntranslatedText{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "SourceText", this.SourceText);
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamSimple(map, prefix + "ProjectId", this.ProjectId);
this.SetParamSimple(map, prefix + "UntranslatedText", this.UntranslatedText);
}
}
}

View File

@@ -0,0 +1,64 @@
/*
* 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.Tmt.V20180321.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class TextTranslateResponse : AbstractModel
{
/// <summary>
/// 翻译后的文本
/// </summary>
[JsonProperty("TargetText")]
public string TargetText{ get; set; }
/// <summary>
/// 源语言详见入参Target
/// </summary>
[JsonProperty("Source")]
public string Source{ get; set; }
/// <summary>
/// 目标语言详见入参Target
/// </summary>
[JsonProperty("Target")]
public string Target{ get; set; }
/// <summary>
/// 唯一请求 ID每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
/// </summary>
[JsonProperty("RequestId")]
public string RequestId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "TargetText", this.TargetText);
this.SetParamSimple(map, prefix + "Source", this.Source);
this.SetParamSimple(map, prefix + "Target", this.Target);
this.SetParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
}

View File

@@ -0,0 +1,268 @@
/*
* 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.Tmt.V20180321
{
using Newtonsoft.Json;
using System.Threading.Tasks;
using TencentCloud.Common;
using TencentCloud.Common.Profile;
using TencentCloud.Tmt.V20180321.Models;
public class TmtClient : AbstractClient{
private const string endpoint = "tmt.tencentcloudapi.com";
private const string version = "2018-03-21";
/// <summary>
/// Client constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
public TmtClient(Credential credential, string region)
: this(credential, region, new ClientProfile())
{
}
/// <summary>
/// Client Constructor.
/// </summary>
/// <param name="credential">Credentials.</param>
/// <param name="region">Region name, such as "ap-guangzhou".</param>
/// <param name="profile">Client profiles.</param>
public TmtClient(Credential credential, string region, ClientProfile profile)
: base(endpoint, version, credential, region, profile)
{
}
/// <summary>
/// 提供中文到英文、英文到中文两种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。<br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
/// </summary>
/// <param name="req"><see cref="ImageTranslateRequest"/></param>
/// <returns><see cref="ImageTranslateResponse"/></returns>
public async Task<ImageTranslateResponse> ImageTranslate(ImageTranslateRequest req)
{
JsonResponseModel<ImageTranslateResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ImageTranslate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ImageTranslateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 提供中文到英文、英文到中文两种语言的图片翻译服务,可自动识别图片中的文本内容并翻译成目标语言,识别后的文本按行翻译,后续会提供可按段落翻译的版本。<br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
/// </summary>
/// <param name="req"><see cref="ImageTranslateRequest"/></param>
/// <returns><see cref="ImageTranslateResponse"/></returns>
public ImageTranslateResponse ImageTranslateSync(ImageTranslateRequest req)
{
JsonResponseModel<ImageTranslateResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ImageTranslate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<ImageTranslateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 可自动识别文本内容的语言种类,轻量高效,无需额外实现判断方式,使面向客户的服务体验更佳。 <br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
/// </summary>
/// <param name="req"><see cref="LanguageDetectRequest"/></param>
/// <returns><see cref="LanguageDetectResponse"/></returns>
public async Task<LanguageDetectResponse> LanguageDetect(LanguageDetectRequest req)
{
JsonResponseModel<LanguageDetectResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "LanguageDetect");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<LanguageDetectResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 可自动识别文本内容的语言种类,轻量高效,无需额外实现判断方式,使面向客户的服务体验更佳。 <br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
/// </summary>
/// <param name="req"><see cref="LanguageDetectRequest"/></param>
/// <returns><see cref="LanguageDetectResponse"/></returns>
public LanguageDetectResponse LanguageDetectSync(LanguageDetectRequest req)
{
JsonResponseModel<LanguageDetectResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "LanguageDetect");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<LanguageDetectResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口提供上传音频,将音频进行语音识别并翻译成文本的服务,目前开放中英互译的语音翻译服务。
/// 待识别和翻译的音频文件可以是 pcm、mp3和speex 格式pcm采样率要求16kHz、位深16bit、单声道音频内语音清晰。<br/>
/// 如果采用流式传输的方式要求每个分片时长200ms~500ms如果采用非流式的传输方式要求音频时长不超过8s。注意最后一个分片的IsEnd参数设置为1。<br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源部分。
/// </summary>
/// <param name="req"><see cref="SpeechTranslateRequest"/></param>
/// <returns><see cref="SpeechTranslateResponse"/></returns>
public async Task<SpeechTranslateResponse> SpeechTranslate(SpeechTranslateRequest req)
{
JsonResponseModel<SpeechTranslateResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "SpeechTranslate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<SpeechTranslateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 本接口提供上传音频,将音频进行语音识别并翻译成文本的服务,目前开放中英互译的语音翻译服务。
/// 待识别和翻译的音频文件可以是 pcm、mp3和speex 格式pcm采样率要求16kHz、位深16bit、单声道音频内语音清晰。<br/>
/// 如果采用流式传输的方式要求每个分片时长200ms~500ms如果采用非流式的传输方式要求音频时长不超过8s。注意最后一个分片的IsEnd参数设置为1。<br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源部分。
/// </summary>
/// <param name="req"><see cref="SpeechTranslateRequest"/></param>
/// <returns><see cref="SpeechTranslateResponse"/></returns>
public SpeechTranslateResponse SpeechTranslateSync(SpeechTranslateRequest req)
{
JsonResponseModel<SpeechTranslateResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "SpeechTranslate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<SpeechTranslateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 提供中文到英文、英文到中文的等多种语言的文本内容翻译服务, 经过大数据语料库、多种解码算法、翻译引擎深度优化,在新闻文章、生活口语等不同语言场景中都有深厚积累,翻译结果专业评价处于行业领先水平。<br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
/// </summary>
/// <param name="req"><see cref="TextTranslateRequest"/></param>
/// <returns><see cref="TextTranslateResponse"/></returns>
public async Task<TextTranslateResponse> TextTranslate(TextTranslateRequest req)
{
JsonResponseModel<TextTranslateResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "TextTranslate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<TextTranslateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 提供中文到英文、英文到中文的等多种语言的文本内容翻译服务, 经过大数据语料库、多种解码算法、翻译引擎深度优化,在新闻文章、生活口语等不同语言场景中都有深厚积累,翻译结果专业评价处于行业领先水平。<br />
/// 提示对于一般开发者我们建议优先使用SDK接入简化开发。SDK使用介绍请直接查看 5. 开发者资源 部分。
/// </summary>
/// <param name="req"><see cref="TextTranslateRequest"/></param>
/// <returns><see cref="TextTranslateResponse"/></returns>
public TextTranslateResponse TextTranslateSync(TextTranslateRequest req)
{
JsonResponseModel<TextTranslateResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "TextTranslate");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<TextTranslateResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 文本翻译的批量接口
/// </summary>
/// <param name="req"><see cref="TextTranslateBatchRequest"/></param>
/// <returns><see cref="TextTranslateBatchResponse"/></returns>
public async Task<TextTranslateBatchResponse> TextTranslateBatch(TextTranslateBatchRequest req)
{
JsonResponseModel<TextTranslateBatchResponse> rsp = null;
try
{
var strResp = await this.InternalRequest(req, "TextTranslateBatch");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<TextTranslateBatchResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
/// <summary>
/// 文本翻译的批量接口
/// </summary>
/// <param name="req"><see cref="TextTranslateBatchRequest"/></param>
/// <returns><see cref="TextTranslateBatchResponse"/></returns>
public TextTranslateBatchResponse TextTranslateBatchSync(TextTranslateBatchRequest req)
{
JsonResponseModel<TextTranslateBatchResponse> rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "TextTranslateBatch");
rsp = JsonConvert.DeserializeObject<JsonResponseModel<TextTranslateBatchResponse>>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
}
}