/* * 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.Sms.V20190711 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Sms.V20190711.Models; public class SmsClient : AbstractClient{ private const string endpoint = "sms.tencentcloudapi.com"; private const string version = "2019-07-11"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public SmsClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public SmsClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 添加短信签名,申请之前请先认证参阅 [腾讯云短信签名审核标准](https://cloud.tencent.com/document/product/382/39022)。 /// >⚠️注意:个人认证用户不支持使用 API 申请短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台申请短信签名,具体操作请参阅 [创建短信签名](https://cloud.tencent.com/document/product/382/36136#Sign)。 /// /// /// public async Task AddSmsSign(AddSmsSignRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AddSmsSign"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 添加短信签名,申请之前请先认证参阅 [腾讯云短信签名审核标准](https://cloud.tencent.com/document/product/382/39022)。 /// >⚠️注意:个人认证用户不支持使用 API 申请短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台申请短信签名,具体操作请参阅 [创建短信签名](https://cloud.tencent.com/document/product/382/36136#Sign)。 /// /// /// public AddSmsSignResponse AddSmsSignSync(AddSmsSignRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AddSmsSign"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 添加短信模版,申请之前请先认证参阅 [腾讯云短信正文模版审核标准](https://cloud.tencent.com/document/product/382/39023)。 /// >⚠️注意:个人认证用户不支持使用 API 申请短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台申请短信正文模版,具体操作请参阅 [创建短信正文模版](https://cloud.tencent.com/document/product/382/36136#Template)。 /// /// /// public async Task AddSmsTemplate(AddSmsTemplateRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "AddSmsTemplate"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 添加短信模版,申请之前请先认证参阅 [腾讯云短信正文模版审核标准](https://cloud.tencent.com/document/product/382/39023)。 /// >⚠️注意:个人认证用户不支持使用 API 申请短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台申请短信正文模版,具体操作请参阅 [创建短信正文模版](https://cloud.tencent.com/document/product/382/36136#Template)。 /// /// /// public AddSmsTemplateResponse AddSmsTemplateSync(AddSmsTemplateRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "AddSmsTemplate"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 统计用户回执的数据。 /// /// /// public async Task CallbackStatusStatistics(CallbackStatusStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CallbackStatusStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 统计用户回执的数据。 /// /// /// public CallbackStatusStatisticsResponse CallbackStatusStatisticsSync(CallbackStatusStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CallbackStatusStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 删除短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),请登录控制台删除短信签名,具体操作请参阅 [短信签名操作](https://cloud.tencent.com/document/product/382/36136#Sign) 中查看删除短信签名须知。 /// /// /// public async Task DeleteSmsSign(DeleteSmsSignRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteSmsSign"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 删除短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),请登录控制台删除短信签名,具体操作请参阅 [短信签名操作](https://cloud.tencent.com/document/product/382/36136#Sign) 中查看删除短信签名须知。 /// /// /// public DeleteSmsSignResponse DeleteSmsSignSync(DeleteSmsSignRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteSmsSign"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 删除短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),请登录控制台删除短信正文模版,具体操作请参阅 [短信正文模版操作](https://cloud.tencent.com/document/product/382/36136#Template) 中查看删除短信正文模版须知。 /// /// /// public async Task DeleteSmsTemplate(DeleteSmsTemplateRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteSmsTemplate"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 删除短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),请登录控制台删除短信正文模版,具体操作请参阅 [短信正文模版操作](https://cloud.tencent.com/document/product/382/36136#Template) 中查看删除短信正文模版须知。 /// /// /// public DeleteSmsTemplateResponse DeleteSmsTemplateSync(DeleteSmsTemplateRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteSmsTemplate"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 查询短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629)。 /// /// /// public async Task DescribeSmsSignList(DescribeSmsSignListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeSmsSignList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 查询短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629)。 /// /// /// public DescribeSmsSignListResponse DescribeSmsSignListSync(DescribeSmsSignListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeSmsSignList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 查询短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629)。 /// /// /// public async Task DescribeSmsTemplateList(DescribeSmsTemplateListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeSmsTemplateList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// >⚠️注意:个人认证用户不支持使用 API 查询短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629)。 /// /// /// public DescribeSmsTemplateListResponse DescribeSmsTemplateListSync(DescribeSmsTemplateListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeSmsTemplateList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改短信签名,修改之前请先认证参阅 [腾讯云短信签名审核标准](https://cloud.tencent.com/document/product/382/39022)。 /// >- ⚠️注意:个人认证用户不支持使用 API 修改短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台修改短信签名。 /// >- 修改短信签名,仅当签名为待审核或已拒绝状态时,才能进行修改,已审核通过的签名不支持修改。 /// /// /// public async Task ModifySmsSign(ModifySmsSignRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifySmsSign"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改短信签名,修改之前请先认证参阅 [腾讯云短信签名审核标准](https://cloud.tencent.com/document/product/382/39022)。 /// >- ⚠️注意:个人认证用户不支持使用 API 修改短信签名,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台修改短信签名。 /// >- 修改短信签名,仅当签名为待审核或已拒绝状态时,才能进行修改,已审核通过的签名不支持修改。 /// /// /// public ModifySmsSignResponse ModifySmsSignSync(ModifySmsSignRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifySmsSign"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改短信正文模版,修改之前请先认真参阅 [腾讯云短信正文模版审核标准](https://cloud.tencent.com/document/product/382/39023)。 /// >- ⚠️注意:个人认证用户不支持使用 API 修改短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台修改短信正文模版。 /// >- 修改短信签名,仅当正文模版为待审核或已拒绝状态时,才能进行修改,已审核通过的正文模版不支持修改。 /// /// /// public async Task ModifySmsTemplate(ModifySmsTemplateRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifySmsTemplate"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改短信正文模版,修改之前请先认真参阅 [腾讯云短信正文模版审核标准](https://cloud.tencent.com/document/product/382/39023)。 /// >- ⚠️注意:个人认证用户不支持使用 API 修改短信正文模版,请参阅了解 [实名认证基本介绍](https://cloud.tencent.com/document/product/378/3629),如果为个人认证请登录控制台修改短信正文模版。 /// >- 修改短信签名,仅当正文模版为待审核或已拒绝状态时,才能进行修改,已审核通过的正文模版不支持修改。 /// /// /// public ModifySmsTemplateResponse ModifySmsTemplateSync(ModifySmsTemplateRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifySmsTemplate"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取短信回复状态。 /// 目前也支持 [配置回复回调](https://cloud.tencent.com/document/product/382/42907) 的方式来获取上行回复。 /// /// /// public async Task PullSmsReplyStatus(PullSmsReplyStatusRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "PullSmsReplyStatus"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取短信回复状态。 /// 目前也支持 [配置回复回调](https://cloud.tencent.com/document/product/382/42907) 的方式来获取上行回复。 /// /// /// public PullSmsReplyStatusResponse PullSmsReplyStatusSync(PullSmsReplyStatusRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "PullSmsReplyStatus"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取单个号码短信回复状态。 /// 目前也支持 [配置回复回调](https://cloud.tencent.com/document/product/382/42907) 的方式来获取上行回复。 /// /// /// public async Task PullSmsReplyStatusByPhoneNumber(PullSmsReplyStatusByPhoneNumberRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "PullSmsReplyStatusByPhoneNumber"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取单个号码短信回复状态。 /// 目前也支持 [配置回复回调](https://cloud.tencent.com/document/product/382/42907) 的方式来获取上行回复。 /// /// /// public PullSmsReplyStatusByPhoneNumberResponse PullSmsReplyStatusByPhoneNumberSync(PullSmsReplyStatusByPhoneNumberRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "PullSmsReplyStatusByPhoneNumber"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取短信下发状态。 /// >- 目前也支持 [配置回调](https://cloud.tencent.com/document/product/382/37809#.E8.AE.BE.E7.BD.AE.E4.BA.8B.E4.BB.B6.E5.9B.9E.E8.B0.83.E9.85.8D.E7.BD.AE) 的方式来获取下发状态。 /// /// /// public async Task PullSmsSendStatus(PullSmsSendStatusRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "PullSmsSendStatus"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取短信下发状态。 /// >- 目前也支持 [配置回调](https://cloud.tencent.com/document/product/382/37809#.E8.AE.BE.E7.BD.AE.E4.BA.8B.E4.BB.B6.E5.9B.9E.E8.B0.83.E9.85.8D.E7.BD.AE) 的方式来获取下发状态。 /// /// /// public PullSmsSendStatusResponse PullSmsSendStatusSync(PullSmsSendStatusRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "PullSmsSendStatus"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取单个号码短信下发状态。 /// >- 目前也支持 [配置回调](https://cloud.tencent.com/document/product/382/37809#.E8.AE.BE.E7.BD.AE.E4.BA.8B.E4.BB.B6.E5.9B.9E.E8.B0.83.E9.85.8D.E7.BD.AE) 的方式来获取下发状态。 /// /// /// public async Task PullSmsSendStatusByPhoneNumber(PullSmsSendStatusByPhoneNumberRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "PullSmsSendStatusByPhoneNumber"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 拉取单个号码短信下发状态。 /// >- 目前也支持 [配置回调](https://cloud.tencent.com/document/product/382/37809#.E8.AE.BE.E7.BD.AE.E4.BA.8B.E4.BB.B6.E5.9B.9E.E8.B0.83.E9.85.8D.E7.BD.AE) 的方式来获取下发状态。 /// /// /// public PullSmsSendStatusByPhoneNumberResponse PullSmsSendStatusByPhoneNumberSync(PullSmsSendStatusByPhoneNumberRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "PullSmsSendStatusByPhoneNumber"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 短信发送接口,用户给用户发短信验证码、通知类短信或营销短信。 /// /// /// /// public async Task SendSms(SendSmsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "SendSms"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 短信发送接口,用户给用户发短信验证码、通知类短信或营销短信。 /// /// /// /// public SendSmsResponse SendSmsSync(SendSmsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "SendSms"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 统计用户发送短信的数据。 /// /// /// public async Task SendStatusStatistics(SendStatusStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "SendStatusStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 统计用户发送短信的数据。 /// /// /// public SendStatusStatisticsResponse SendStatusStatisticsSync(SendStatusStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "SendStatusStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户套餐包信息统计。 /// /// /// public async Task SmsPackagesStatistics(SmsPackagesStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "SmsPackagesStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户套餐包信息统计。 /// /// /// public SmsPackagesStatisticsResponse SmsPackagesStatisticsSync(SmsPackagesStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "SmsPackagesStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }