/* * 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.Cloudaudit.V20190319 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Cloudaudit.V20190319.Models; public class CloudauditClient : AbstractClient{ private const string endpoint = "cloudaudit.tencentcloudapi.com"; private const string version = "2019-03-19"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public CloudauditClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public CloudauditClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 参数要求: /// 1、如果IsCreateNewBucket的值存在的话,cosRegion和cosBucketName都是必填参数。 /// 2、如果IsEnableCmqNotify的值是1的话,IsCreateNewQueue、CmqRegion和CmqQueueName都是必填参数。 /// 3、如果IsEnableCmqNotify的值是0的话,IsCreateNewQueue、CmqRegion和CmqQueueName都不能传。 /// 4、如果IsEnableKmsEncry的值是1的话,KmsRegion和KeyId属于必填项 /// /// /// public async Task CreateAudit(CreateAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 参数要求: /// 1、如果IsCreateNewBucket的值存在的话,cosRegion和cosBucketName都是必填参数。 /// 2、如果IsEnableCmqNotify的值是1的话,IsCreateNewQueue、CmqRegion和CmqQueueName都是必填参数。 /// 3、如果IsEnableCmqNotify的值是0的话,IsCreateNewQueue、CmqRegion和CmqQueueName都不能传。 /// 4、如果IsEnableKmsEncry的值是1的话,KmsRegion和KeyId属于必填项 /// /// /// public CreateAuditResponse CreateAuditSync(CreateAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除跟踪集 /// /// /// public async Task DeleteAudit(DeleteAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DeleteAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 删除跟踪集 /// /// /// public DeleteAuditResponse DeleteAuditSync(DeleteAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DeleteAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询跟踪集详情 /// /// /// public async Task DescribeAudit(DescribeAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询跟踪集详情 /// /// /// public DescribeAuditResponse DescribeAuditSync(DescribeAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询AttributeKey的有效取值范围 /// /// /// public async Task GetAttributeKey(GetAttributeKeyRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "GetAttributeKey"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询AttributeKey的有效取值范围 /// /// /// public GetAttributeKeyResponse GetAttributeKeySync(GetAttributeKeyRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "GetAttributeKey"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户可创建跟踪集的数量 /// /// /// public async Task InquireAuditCredit(InquireAuditCreditRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "InquireAuditCredit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询用户可创建跟踪集的数量 /// /// /// public InquireAuditCreditResponse InquireAuditCreditSync(InquireAuditCreditRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "InquireAuditCredit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询跟踪集概要 /// /// /// public async Task ListAudits(ListAuditsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ListAudits"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询跟踪集概要 /// /// /// public ListAuditsResponse ListAuditsSync(ListAuditsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ListAudits"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询云审计支持的cmq的可用区 /// /// /// public async Task ListCmqEnableRegion(ListCmqEnableRegionRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ListCmqEnableRegion"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询云审计支持的cmq的可用区 /// /// /// public ListCmqEnableRegionResponse ListCmqEnableRegionSync(ListCmqEnableRegionRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ListCmqEnableRegion"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询云审计支持的cos可用区 /// /// /// public async Task ListCosEnableRegion(ListCosEnableRegionRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ListCosEnableRegion"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 查询云审计支持的cos可用区 /// /// /// public ListCosEnableRegionResponse ListCosEnableRegionSync(ListCosEnableRegionRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ListCosEnableRegion"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用于对操作日志进行检索,便于用户进行查询相关的操作信息。 /// /// /// public async Task LookUpEvents(LookUpEventsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "LookUpEvents"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 用于对操作日志进行检索,便于用户进行查询相关的操作信息。 /// /// /// public LookUpEventsResponse LookUpEventsSync(LookUpEventsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "LookUpEvents"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 开启跟踪集 /// /// /// public async Task StartLogging(StartLoggingRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "StartLogging"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 开启跟踪集 /// /// /// public StartLoggingResponse StartLoggingSync(StartLoggingRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "StartLogging"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 关闭跟踪集 /// /// /// public async Task StopLogging(StopLoggingRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "StopLogging"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 关闭跟踪集 /// /// /// public StopLoggingResponse StopLoggingSync(StopLoggingRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "StopLogging"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 参数要求: /// 1、如果IsCreateNewBucket的值存在的话,cosRegion和cosBucketName都是必填参数。 /// 2、如果IsEnableCmqNotify的值是1的话,IsCreateNewQueue、CmqRegion和CmqQueueName都是必填参数。 /// 3、如果IsEnableCmqNotify的值是0的话,IsCreateNewQueue、CmqRegion和CmqQueueName都不能传。 /// 4、如果IsEnableKmsEncry的值是1的话,KmsRegion和KeyId属于必填项 /// /// /// public async Task UpdateAudit(UpdateAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "UpdateAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 参数要求: /// 1、如果IsCreateNewBucket的值存在的话,cosRegion和cosBucketName都是必填参数。 /// 2、如果IsEnableCmqNotify的值是1的话,IsCreateNewQueue、CmqRegion和CmqQueueName都是必填参数。 /// 3、如果IsEnableCmqNotify的值是0的话,IsCreateNewQueue、CmqRegion和CmqQueueName都不能传。 /// 4、如果IsEnableKmsEncry的值是1的话,KmsRegion和KeyId属于必填项 /// /// /// public UpdateAuditResponse UpdateAuditSync(UpdateAuditRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "UpdateAudit"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }