/* * 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.Ckafka.V20190819 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Ckafka.V20190819.Models; public class CkafkaClient : AbstractClient{ private const string endpoint = "ckafka.tencentcloudapi.com"; private const string version = "2019-08-19"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public CkafkaClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public CkafkaClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 添加 ACL 策略 /// /// /// public async Task CreateAcl(CreateAclRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateAcl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 添加 ACL 策略 /// /// /// public CreateAclResponse CreateAclSync(CreateAclRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateAcl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于增加主题中的分区 /// /// /// public async Task CreatePartition(CreatePartitionRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreatePartition"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于增加主题中的分区 /// /// /// public CreatePartitionResponse CreatePartitionSync(CreatePartitionRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreatePartition"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 创建ckafka主题 /// /// /// public async Task CreateTopic(CreateTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 创建ckafka主题 /// /// /// public CreateTopicResponse CreateTopicSync(CreateTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 创建主题ip白名单 /// /// /// public async Task CreateTopicIpWhiteList(CreateTopicIpWhiteListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateTopicIpWhiteList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 创建主题ip白名单 /// /// /// public CreateTopicIpWhiteListResponse CreateTopicIpWhiteListSync(CreateTopicIpWhiteListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateTopicIpWhiteList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 添加用户 /// /// /// public async Task CreateUser(CreateUserRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 添加用户 /// /// /// public CreateUserResponse CreateUserSync(CreateUserRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除ACL /// /// /// public async Task DeleteAcl(DeleteAclRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteAcl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除ACL /// /// /// public DeleteAclResponse DeleteAclSync(DeleteAclRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteAcl"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除ckafka主题 /// /// /// public async Task DeleteTopic(DeleteTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除ckafka主题 /// /// /// public DeleteTopicResponse DeleteTopicSync(DeleteTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除主题IP白名单 /// /// /// public async Task DeleteTopicIpWhiteList(DeleteTopicIpWhiteListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteTopicIpWhiteList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除主题IP白名单 /// /// /// public DeleteTopicIpWhiteListResponse DeleteTopicIpWhiteListSync(DeleteTopicIpWhiteListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteTopicIpWhiteList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除用户 /// /// /// public async Task DeleteUser(DeleteUserRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除用户 /// /// /// public DeleteUserResponse DeleteUserSync(DeleteUserRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 枚举ACL /// /// /// public async Task DescribeACL(DescribeACLRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeACL"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 枚举ACL /// /// /// public DescribeACLResponse DescribeACLSync(DescribeACLRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeACL"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户列表 /// /// /// public async Task DescribeAppInfo(DescribeAppInfoRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeAppInfo"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户列表 /// /// /// public DescribeAppInfoResponse DescribeAppInfoSync(DescribeAppInfoRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeAppInfo"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询消费分组信息 /// /// /// public async Task DescribeConsumerGroup(DescribeConsumerGroupRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeConsumerGroup"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询消费分组信息 /// /// /// public DescribeConsumerGroupResponse DescribeConsumerGroupSync(DescribeConsumerGroupRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeConsumerGroup"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 枚举消费分组(精简版) /// /// /// public async Task DescribeGroup(DescribeGroupRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeGroup"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 枚举消费分组(精简版) /// /// /// public DescribeGroupResponse DescribeGroupSync(DescribeGroupRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeGroup"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取消费分组信息 /// /// /// public async Task DescribeGroupInfo(DescribeGroupInfoRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeGroupInfo"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取消费分组信息 /// /// /// public DescribeGroupInfoResponse DescribeGroupInfoSync(DescribeGroupInfoRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeGroupInfo"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取消费分组offset /// /// /// public async Task DescribeGroupOffsets(DescribeGroupOffsetsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeGroupOffsets"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取消费分组offset /// /// /// public DescribeGroupOffsetsResponse DescribeGroupOffsetsSync(DescribeGroupOffsetsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeGroupOffsets"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取实例属性 /// /// /// public async Task DescribeInstanceAttributes(DescribeInstanceAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeInstanceAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取实例属性 /// /// /// public DescribeInstanceAttributesResponse DescribeInstanceAttributesSync(DescribeInstanceAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeInstanceAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeInstance)用于在用户账户下获取消息队列 CKafka 实例列表 /// /// /// public async Task DescribeInstances(DescribeInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeInstance)用于在用户账户下获取消息队列 CKafka 实例列表 /// /// /// public DescribeInstancesResponse DescribeInstancesSync(DescribeInstancesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeInstances"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户账户下获取实例列表详情 /// /// /// public async Task DescribeInstancesDetail(DescribeInstancesDetailRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeInstancesDetail"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用户账户下获取实例列表详情 /// /// /// public DescribeInstancesDetailResponse DescribeInstancesDetailSync(DescribeInstancesDetailRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeInstancesDetail"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 接口请求域名:https://ckafka.tencentcloudapi.com /// 本接口(DescribeTopic)用于在用户获取消息队列 CKafka 实例的主题列表 /// /// /// public async Task DescribeTopic(DescribeTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 接口请求域名:https://ckafka.tencentcloudapi.com /// 本接口(DescribeTopic)用于在用户获取消息队列 CKafka 实例的主题列表 /// /// /// public DescribeTopicResponse DescribeTopicSync(DescribeTopicRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeTopic"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取主题属性 /// /// /// public async Task DescribeTopicAttributes(DescribeTopicAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeTopicAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取主题属性 /// /// /// public DescribeTopicAttributesResponse DescribeTopicAttributesSync(DescribeTopicAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeTopicAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取主题列表详情(仅控制台调用) /// /// /// public async Task DescribeTopicDetail(DescribeTopicDetailRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeTopicDetail"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 获取主题列表详情(仅控制台调用) /// /// /// public DescribeTopicDetailResponse DescribeTopicDetailSync(DescribeTopicDetailRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeTopicDetail"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户信息 /// /// /// public async Task DescribeUser(DescribeUserRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户信息 /// /// /// public DescribeUserResponse DescribeUserSync(DescribeUserRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeUser"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置Groups 消费分组offset /// /// /// public async Task ModifyGroupOffsets(ModifyGroupOffsetsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyGroupOffsets"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置Groups 消费分组offset /// /// /// public ModifyGroupOffsetsResponse ModifyGroupOffsetsSync(ModifyGroupOffsetsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyGroupOffsets"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置实例属性 /// /// /// public async Task ModifyInstanceAttributes(ModifyInstanceAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyInstanceAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 设置实例属性 /// /// /// public ModifyInstanceAttributesResponse ModifyInstanceAttributesSync(ModifyInstanceAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyInstanceAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改密码 /// /// /// public async Task ModifyPassword(ModifyPasswordRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyPassword"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 修改密码 /// /// /// public ModifyPasswordResponse ModifyPasswordSync(ModifyPasswordRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyPassword"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于修改主题属性。 /// /// /// public async Task ModifyTopicAttributes(ModifyTopicAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyTopicAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于修改主题属性。 /// /// /// public ModifyTopicAttributesResponse ModifyTopicAttributesSync(ModifyTopicAttributesRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyTopicAttributes"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }