/* * 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.Tiw.V20190919 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Tiw.V20190919.Models; public class TiwClient : AbstractClient{ private const string endpoint = "tiw.tencentcloudapi.com"; private const string version = "2019-09-19"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public TiwClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public TiwClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 创建一个文档转码任务 /// /// /// public async Task CreateTranscode(CreateTranscodeRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateTranscode"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 创建一个文档转码任务 /// /// /// public CreateTranscodeResponse CreateTranscodeSync(CreateTranscodeRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateTranscode"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询实时录制任务状态与结果 /// /// /// public async Task DescribeOnlineRecord(DescribeOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询实时录制任务状态与结果 /// /// /// public DescribeOnlineRecordResponse DescribeOnlineRecordSync(DescribeOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询实时录制回调地址 /// /// /// public async Task DescribeOnlineRecordCallback(DescribeOnlineRecordCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeOnlineRecordCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询实时录制回调地址 /// /// /// public DescribeOnlineRecordCallbackResponse DescribeOnlineRecordCallbackSync(DescribeOnlineRecordCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeOnlineRecordCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询文档转码任务的执行进度与转码结果 /// /// /// public async Task DescribeTranscode(DescribeTranscodeRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeTranscode"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询文档转码任务的执行进度与转码结果 /// /// /// public DescribeTranscodeResponse DescribeTranscodeSync(DescribeTranscodeRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeTranscode"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询文档转码回调地址 /// /// /// public async Task DescribeTranscodeCallback(DescribeTranscodeCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeTranscodeCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询文档转码回调地址 /// /// /// public DescribeTranscodeCallbackResponse DescribeTranscodeCallbackSync(DescribeTranscodeCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeTranscodeCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 暂停实时录制 /// /// /// public async Task PauseOnlineRecord(PauseOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "PauseOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 暂停实时录制 /// /// /// public PauseOnlineRecordResponse PauseOnlineRecordSync(PauseOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "PauseOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 恢复实时录制 /// /// /// public async Task ResumeOnlineRecord(ResumeOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ResumeOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 恢复实时录制 /// /// /// public ResumeOnlineRecordResponse ResumeOnlineRecordSync(ResumeOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ResumeOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置实时录制回调地址 /// /// /// public async Task SetOnlineRecordCallback(SetOnlineRecordCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "SetOnlineRecordCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置实时录制回调地址 /// /// /// public SetOnlineRecordCallbackResponse SetOnlineRecordCallbackSync(SetOnlineRecordCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "SetOnlineRecordCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置文档转码回调地址 /// /// /// public async Task SetTranscodeCallback(SetTranscodeCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "SetTranscodeCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置文档转码回调地址 /// /// /// public SetTranscodeCallbackResponse SetTranscodeCallbackSync(SetTranscodeCallbackRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "SetTranscodeCallback"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 发起一个实时录制任务 /// /// /// public async Task StartOnlineRecord(StartOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "StartOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 发起一个实时录制任务 /// /// /// public StartOnlineRecordResponse StartOnlineRecordSync(StartOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "StartOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 停止实时录制 /// /// /// public async Task StopOnlineRecord(StopOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "StopOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 停止实时录制 /// /// /// public StopOnlineRecordResponse StopOnlineRecordSync(StopOnlineRecordRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "StopOnlineRecord"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }