Fix bugs.

This commit is contained in:
sdk-team
2022-06-22 07:00:21 +00:00
parent 5cb1bae857
commit 585388b892
25 changed files with 45 additions and 672 deletions

View File

@@ -2931,42 +2931,6 @@ ConfigClient::ListResourceEvaluationResultsOutcomeCallable ConfigClient::listRes
return task->get_future();
}
ConfigClient::ListTagResourcesOutcome ConfigClient::listTagResources(const ListTagResourcesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListTagResourcesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListTagResourcesOutcome(ListTagResourcesResult(outcome.result()));
else
return ListTagResourcesOutcome(outcome.error());
}
void ConfigClient::listTagResourcesAsync(const ListTagResourcesRequest& request, const ListTagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listTagResources(request), context);
};
asyncExecute(new Runnable(fn));
}
ConfigClient::ListTagResourcesOutcomeCallable ConfigClient::listTagResourcesCallable(const ListTagResourcesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListTagResourcesOutcome()>>(
[this, request]()
{
return this->listTagResources(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ConfigClient::RevertAggregateEvaluationResultsOutcome ConfigClient::revertAggregateEvaluationResults(const RevertAggregateEvaluationResultsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -3147,78 +3111,6 @@ ConfigClient::StartRemediationOutcomeCallable ConfigClient::startRemediationCall
return task->get_future();
}
ConfigClient::TagResourcesOutcome ConfigClient::tagResources(const TagResourcesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return TagResourcesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return TagResourcesOutcome(TagResourcesResult(outcome.result()));
else
return TagResourcesOutcome(outcome.error());
}
void ConfigClient::tagResourcesAsync(const TagResourcesRequest& request, const TagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, tagResources(request), context);
};
asyncExecute(new Runnable(fn));
}
ConfigClient::TagResourcesOutcomeCallable ConfigClient::tagResourcesCallable(const TagResourcesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<TagResourcesOutcome()>>(
[this, request]()
{
return this->tagResources(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ConfigClient::UntagResourcesOutcome ConfigClient::untagResources(const UntagResourcesRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UntagResourcesOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UntagResourcesOutcome(UntagResourcesResult(outcome.result()));
else
return UntagResourcesOutcome(outcome.error());
}
void ConfigClient::untagResourcesAsync(const UntagResourcesRequest& request, const UntagResourcesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, untagResources(request), context);
};
asyncExecute(new Runnable(fn));
}
ConfigClient::UntagResourcesOutcomeCallable ConfigClient::untagResourcesCallable(const UntagResourcesRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UntagResourcesOutcome()>>(
[this, request]()
{
return this->untagResources(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
ConfigClient::UpdateAggregateCompliancePackOutcome ConfigClient::updateAggregateCompliancePack(const UpdateAggregateCompliancePackRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -82,6 +82,8 @@ void GetAggregateConfigRuleResult::parse(const std::string &payload)
configRule_.excludeFolderIdsScope = configRuleNode["ExcludeFolderIdsScope"].asString();
if(!configRuleNode["ExcludeAccountIdsScope"].isNull())
configRule_.excludeAccountIdsScope = configRuleNode["ExcludeAccountIdsScope"].asString();
if(!configRuleNode["AccountId"].isNull())
configRule_.accountId = std::stol(configRuleNode["AccountId"].asString());
auto sourceNode = configRuleNode["Source"];
if(!sourceNode["Owner"].isNull())
configRule_.source.owner = sourceNode["Owner"].asString();
@@ -166,6 +168,11 @@ void GetAggregateConfigRuleResult::parse(const std::string &payload)
auto allComplianceResourceTypes = scopeNode["ComplianceResourceTypes"]["ComplianceResourceTypes"];
for (auto value : allComplianceResourceTypes)
configRule_.scope.complianceResourceTypes.push_back(value.asString());
auto complianceNode = configRuleNode["Compliance"];
if(!complianceNode["ComplianceType"].isNull())
configRule_.compliance.complianceType = complianceNode["ComplianceType"].asString();
if(!complianceNode["Count"].isNull())
configRule_.compliance.count = std::stoi(complianceNode["Count"].asString());
}

View File

@@ -76,6 +76,8 @@ void GetConfigRuleResult::parse(const std::string &payload)
configRule_.configRuleTriggerTypes = configRuleNode["ConfigRuleTriggerTypes"].asString();
if(!configRuleNode["TagKeyLogicScope"].isNull())
configRule_.tagKeyLogicScope = configRuleNode["TagKeyLogicScope"].asString();
if(!configRuleNode["AccountId"].isNull())
configRule_.accountId = std::stol(configRuleNode["AccountId"].asString());
auto sourceNode = configRuleNode["Source"];
if(!sourceNode["Owner"].isNull())
configRule_.source.owner = sourceNode["Owner"].asString();
@@ -160,6 +162,11 @@ void GetConfigRuleResult::parse(const std::string &payload)
auto allComplianceResourceTypes = scopeNode["ComplianceResourceTypes"]["ComplianceResourceTypes"];
for (auto value : allComplianceResourceTypes)
configRule_.scope.complianceResourceTypes.push_back(value.asString());
auto complianceNode = configRuleNode["Compliance"];
if(!complianceNode["ComplianceType"].isNull())
configRule_.compliance.complianceType = complianceNode["ComplianceType"].asString();
if(!complianceNode["Count"].isNull())
configRule_.compliance.count = std::stoi(complianceNode["Count"].asString());
}

View File

@@ -20,7 +20,7 @@ using AlibabaCloud::Config::Model::ListAggregateCompliancePacksRequest;
ListAggregateCompliancePacksRequest::ListAggregateCompliancePacksRequest()
: RpcServiceRequest("config", "2020-09-07", "ListAggregateCompliancePacks") {
setMethod(HttpRequest::Method::Get);
setMethod(HttpRequest::Method::Post);
}
ListAggregateCompliancePacksRequest::~ListAggregateCompliancePacksRequest() {}

View File

@@ -20,7 +20,7 @@ using AlibabaCloud::Config::Model::ListAggregateConfigRulesRequest;
ListAggregateConfigRulesRequest::ListAggregateConfigRulesRequest()
: RpcServiceRequest("config", "2020-09-07", "ListAggregateConfigRules") {
setMethod(HttpRequest::Method::Get);
setMethod(HttpRequest::Method::Post);
}
ListAggregateConfigRulesRequest::~ListAggregateConfigRulesRequest() {}

View File

@@ -20,7 +20,7 @@ using AlibabaCloud::Config::Model::ListAggregatorsRequest;
ListAggregatorsRequest::ListAggregatorsRequest()
: RpcServiceRequest("config", "2020-09-07", "ListAggregators") {
setMethod(HttpRequest::Method::Get);
setMethod(HttpRequest::Method::Post);
}
ListAggregatorsRequest::~ListAggregatorsRequest() {}

View File

@@ -20,7 +20,7 @@ using AlibabaCloud::Config::Model::ListCompliancePacksRequest;
ListCompliancePacksRequest::ListCompliancePacksRequest()
: RpcServiceRequest("config", "2020-09-07", "ListCompliancePacks") {
setMethod(HttpRequest::Method::Get);
setMethod(HttpRequest::Method::Post);
}
ListCompliancePacksRequest::~ListCompliancePacksRequest() {}

View File

@@ -1,27 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud 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.
*/
#include <alibabacloud/config/model/ListTagResourcesRequest.h>
using AlibabaCloud::Config::Model::ListTagResourcesRequest;
ListTagResourcesRequest::ListTagResourcesRequest()
: RpcServiceRequest("config", "2020-09-07", "ListTagResources") {
setMethod(HttpRequest::Method::Post);
}
ListTagResourcesRequest::~ListTagResourcesRequest() {}

View File

@@ -1,70 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud 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.
*/
#include <alibabacloud/config/model/ListTagResourcesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Config;
using namespace AlibabaCloud::Config::Model;
ListTagResourcesResult::ListTagResourcesResult() :
ServiceResult()
{}
ListTagResourcesResult::ListTagResourcesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListTagResourcesResult::~ListTagResourcesResult()
{}
void ListTagResourcesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allTagResourcesNode = value["TagResources"]["TagResource"];
for (auto valueTagResourcesTagResource : allTagResourcesNode)
{
TagResource tagResourcesObject;
if(!valueTagResourcesTagResource["ResourceType"].isNull())
tagResourcesObject.resourceType = valueTagResourcesTagResource["ResourceType"].asString();
if(!valueTagResourcesTagResource["TagValue"].isNull())
tagResourcesObject.tagValue = valueTagResourcesTagResource["TagValue"].asString();
if(!valueTagResourcesTagResource["ResourceId"].isNull())
tagResourcesObject.resourceId = valueTagResourcesTagResource["ResourceId"].asString();
if(!valueTagResourcesTagResource["TagKey"].isNull())
tagResourcesObject.tagKey = valueTagResourcesTagResource["TagKey"].asString();
tagResources_.push_back(tagResourcesObject);
}
if(!value["NextToken"].isNull())
nextToken_ = value["NextToken"].asString();
}
std::string ListTagResourcesResult::getNextToken()const
{
return nextToken_;
}
std::vector<ListTagResourcesResult::TagResource> ListTagResourcesResult::getTagResources()const
{
return tagResources_;
}

View File

@@ -1,27 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud 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.
*/
#include <alibabacloud/config/model/TagResourcesRequest.h>
using AlibabaCloud::Config::Model::TagResourcesRequest;
TagResourcesRequest::TagResourcesRequest()
: RpcServiceRequest("config", "2020-09-07", "TagResources") {
setMethod(HttpRequest::Method::Post);
}
TagResourcesRequest::~TagResourcesRequest() {}

View File

@@ -1,44 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud 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.
*/
#include <alibabacloud/config/model/TagResourcesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Config;
using namespace AlibabaCloud::Config::Model;
TagResourcesResult::TagResourcesResult() :
ServiceResult()
{}
TagResourcesResult::TagResourcesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
TagResourcesResult::~TagResourcesResult()
{}
void TagResourcesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}

View File

@@ -1,27 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud 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.
*/
#include <alibabacloud/config/model/UntagResourcesRequest.h>
using AlibabaCloud::Config::Model::UntagResourcesRequest;
UntagResourcesRequest::UntagResourcesRequest()
: RpcServiceRequest("config", "2020-09-07", "UntagResources") {
setMethod(HttpRequest::Method::Post);
}
UntagResourcesRequest::~UntagResourcesRequest() {}

View File

@@ -1,44 +0,0 @@
/*
* Copyright 2009-2017 Alibaba Cloud 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.
*/
#include <alibabacloud/config/model/UntagResourcesResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Config;
using namespace AlibabaCloud::Config::Model;
UntagResourcesResult::UntagResourcesResult() :
ServiceResult()
{}
UntagResourcesResult::UntagResourcesResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UntagResourcesResult::~UntagResourcesResult()
{}
void UntagResourcesResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
}