/*
* 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.Npp.V20190823
{
using Newtonsoft.Json;
using System.Threading.Tasks;
using TencentCloud.Common;
using TencentCloud.Common.Profile;
using TencentCloud.Npp.V20190823.Models;
public class NppClient : AbstractClient{
private const string endpoint = "npp.tencentcloudapi.com";
private const string version = "2019-08-23";
///
/// Client constructor.
///
/// Credentials.
/// Region name, such as "ap-guangzhou".
public NppClient(Credential credential, string region)
: this(credential, region, new ClientProfile())
{
}
///
/// Client Constructor.
///
/// Credentials.
/// Region name, such as "ap-guangzhou".
/// Client profiles.
public NppClient(Credential credential, string region, ClientProfile profile)
: base(endpoint, version, credential, region, profile)
{
}
///
/// 回拨呼叫请求
///
///
///
public async Task CreateCallBack(CreateCallBackRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateCallBack");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨呼叫请求
///
///
///
public CreateCallBackResponse CreateCallBackSync(CreateCallBackRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateCallBack");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 直拨解绑中间号
///
///
///
public async Task DelVirtualNum(DelVirtualNumRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DelVirtualNum");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 直拨解绑中间号
///
///
///
public DelVirtualNumResponse DelVirtualNumSync(DelVirtualNumRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DelVirtualNum");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨呼叫取消
///
///
///
public async Task DeleteCallBack(DeleteCallBackRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteCallBack");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨呼叫取消
///
///
///
public DeleteCallBackResponse DeleteCallBackSync(DeleteCallBackRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteCallBack");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨话单获取接口
///
///
///
public async Task DescribeCallBackCdr(DescribeCallBackCdrRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeCallBackCdr");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨话单获取接口
///
///
///
public DescribeCallBackCdrResponse DescribeCallBackCdrSync(DescribeCallBackCdrRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeCallBackCdr");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨通话状态获取
///
///
///
public async Task DescribeCallBackStatus(DescribeCallBackStatusRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeCallBackStatus");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨通话状态获取
///
///
///
public DescribeCallBackStatusResponse DescribeCallBackStatusSync(DescribeCallBackStatusRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeCallBackStatus");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨拉取主叫显号号码集合
///
///
///
public async Task DescribeCallerDisplayList(DescribeCallerDisplayListRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeCallerDisplayList");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 回拨拉取主叫显号号码集合
///
///
///
public DescribeCallerDisplayListResponse DescribeCallerDisplayListSync(DescribeCallerDisplayListRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeCallerDisplayList");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 直拨话单获取接口
///
///
///
public async Task Get400Cdr(Get400CdrRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "Get400Cdr");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 直拨话单获取接口
///
///
///
public Get400CdrResponse Get400CdrSync(Get400CdrRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "Get400Cdr");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 直拨获取中间号(App 使用方发起)
///
///
///
public async Task GetVirtualNum(GetVirtualNumRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "GetVirtualNum");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 直拨获取中间号(App 使用方发起)
///
///
///
public GetVirtualNumResponse GetVirtualNumSync(GetVirtualNumRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "GetVirtualNum");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
}
}