/* * 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.Ame.V20190916 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Ame.V20190916.Models; public class AmeClient : AbstractClient{ private const string endpoint = "ame.tencentcloudapi.com"; private const string version = "2019-09-16"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public AmeClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public AmeClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 分类内容下歌曲列表获取,根据CategoryID或CategoryCode /// /// /// public async Task DescribeItems(DescribeItemsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeItems"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 分类内容下歌曲列表获取,根据CategoryID或CategoryCode /// /// /// public DescribeItemsResponse DescribeItemsSync(DescribeItemsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeItems"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据接口的模式及歌曲ID来取得歌词信息。 /// /// /// public async Task DescribeLyric(DescribeLyricRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeLyric"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据接口的模式及歌曲ID来取得歌词信息。 /// /// /// public DescribeLyricResponse DescribeLyricSync(DescribeLyricRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeLyric"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据接口的模式及歌曲ID来取得对应权限的歌曲播放地址等信息。 /// /// /// public async Task DescribeMusic(DescribeMusicRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeMusic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据接口的模式及歌曲ID来取得对应权限的歌曲播放地址等信息。 /// /// /// public DescribeMusicResponse DescribeMusicSync(DescribeMusicRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeMusic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取素材库列表时使用 /// /// /// public async Task DescribeStations(DescribeStationsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeStations"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取素材库列表时使用 /// /// /// public DescribeStationsResponse DescribeStationsSync(DescribeStationsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeStations"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 客户上报用户数据功能,为了更好的为用户提供优质服务 /// /// /// public async Task ReportData(ReportDataRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ReportData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 客户上报用户数据功能,为了更好的为用户提供优质服务 /// /// /// public ReportDataResponse ReportDataSync(ReportDataRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ReportData"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }