Generated 2019-09-10 for waf-openapi.

This commit is contained in:
sdk-team
2020-05-13 15:34:52 +08:00
parent 396541400e
commit bb7f64aeb3
17 changed files with 631 additions and 18 deletions

View File

@@ -267,6 +267,42 @@ Waf_openapiClient::DeleteDomainOutcomeCallable Waf_openapiClient::deleteDomainCa
return task->get_future();
}
Waf_openapiClient::DeleteInstanceOutcome Waf_openapiClient::deleteInstance(const DeleteInstanceRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteInstanceOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteInstanceOutcome(DeleteInstanceResult(outcome.result()));
else
return DeleteInstanceOutcome(outcome.error());
}
void Waf_openapiClient::deleteInstanceAsync(const DeleteInstanceRequest& request, const DeleteInstanceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteInstance(request), context);
};
asyncExecute(new Runnable(fn));
}
Waf_openapiClient::DeleteInstanceOutcomeCallable Waf_openapiClient::deleteInstanceCallable(const DeleteInstanceRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteInstanceOutcome()>>(
[this, request]()
{
return this->deleteInstance(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Waf_openapiClient::DescribeCertMatchStatusOutcome Waf_openapiClient::describeCertMatchStatus(const DescribeCertMatchStatusRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -735,6 +771,42 @@ Waf_openapiClient::DescribeProtectionModuleRulesOutcomeCallable Waf_openapiClien
return task->get_future();
}
Waf_openapiClient::DescribeProtectionModuleRulesByIdListOutcome Waf_openapiClient::describeProtectionModuleRulesByIdList(const DescribeProtectionModuleRulesByIdListRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeProtectionModuleRulesByIdListOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeProtectionModuleRulesByIdListOutcome(DescribeProtectionModuleRulesByIdListResult(outcome.result()));
else
return DescribeProtectionModuleRulesByIdListOutcome(outcome.error());
}
void Waf_openapiClient::describeProtectionModuleRulesByIdListAsync(const DescribeProtectionModuleRulesByIdListRequest& request, const DescribeProtectionModuleRulesByIdListAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeProtectionModuleRulesByIdList(request), context);
};
asyncExecute(new Runnable(fn));
}
Waf_openapiClient::DescribeProtectionModuleRulesByIdListOutcomeCallable Waf_openapiClient::describeProtectionModuleRulesByIdListCallable(const DescribeProtectionModuleRulesByIdListRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeProtectionModuleRulesByIdListOutcome()>>(
[this, request]()
{
return this->describeProtectionModuleRulesByIdList(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Waf_openapiClient::DescribeProtectionModuleStatusOutcome Waf_openapiClient::describeProtectionModuleStatus(const DescribeProtectionModuleStatusRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,73 @@
/*
* 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/waf-openapi/model/DeleteInstanceRequest.h>
using AlibabaCloud::Waf_openapi::Model::DeleteInstanceRequest;
DeleteInstanceRequest::DeleteInstanceRequest() :
RpcServiceRequest("waf-openapi", "2019-09-10", "DeleteInstance")
{
setMethod(HttpRequest::Method::Post);
}
DeleteInstanceRequest::~DeleteInstanceRequest()
{}
std::string DeleteInstanceRequest::getResourceGroupId()const
{
return resourceGroupId_;
}
void DeleteInstanceRequest::setResourceGroupId(const std::string& resourceGroupId)
{
resourceGroupId_ = resourceGroupId;
setParameter("ResourceGroupId", resourceGroupId);
}
std::string DeleteInstanceRequest::getInstanceId()const
{
return instanceId_;
}
void DeleteInstanceRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
std::string DeleteInstanceRequest::getSourceIp()const
{
return sourceIp_;
}
void DeleteInstanceRequest::setSourceIp(const std::string& sourceIp)
{
sourceIp_ = sourceIp;
setParameter("SourceIp", sourceIp);
}
std::string DeleteInstanceRequest::getLang()const
{
return lang_;
}
void DeleteInstanceRequest::setLang(const std::string& lang)
{
lang_ = lang;
setParameter("Lang", lang);
}

View File

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

View File

@@ -52,8 +52,6 @@ void DescribeDomainResult::parse(const std::string &payload)
domain_.isAccessProduct = std::stoi(domainNode["IsAccessProduct"].asString());
if(!domainNode["Version"].isNull())
domain_.version = std::stol(domainNode["Version"].asString());
if(!domainNode["LogHeaders"].isNull())
domain_.logHeaders = domainNode["LogHeaders"].asString();
if(!domainNode["ClusterType"].isNull())
domain_.clusterType = std::stoi(domainNode["ClusterType"].asString());
if(!domainNode["ConnectionTime"].isNull())
@@ -62,6 +60,18 @@ void DescribeDomainResult::parse(const std::string &payload)
domain_.readTime = std::stoi(domainNode["ReadTime"].asString());
if(!domainNode["WriteTime"].isNull())
domain_.writeTime = std::stoi(domainNode["WriteTime"].asString());
if(!domainNode["ResourceGroupId"].isNull())
domain_.resourceGroupId = domainNode["ResourceGroupId"].asString();
auto allLogHeadersNode = domainNode["LogHeaders"]["LogHeader"];
for (auto domainNodeLogHeadersLogHeader : allLogHeadersNode)
{
Domain::LogHeader logHeaderObject;
if(!domainNodeLogHeadersLogHeader["v"].isNull())
logHeaderObject.v = domainNodeLogHeadersLogHeader["v"].asString();
if(!domainNodeLogHeadersLogHeader["k"].isNull())
logHeaderObject.k = domainNodeLogHeadersLogHeader["k"].asString();
domain_.logHeaders.push_back(logHeaderObject);
}
auto allSourceIps = domainNode["SourceIps"]["SourceIp"];
for (auto value : allSourceIps)
domain_.sourceIps.push_back(value.asString());

View File

@@ -0,0 +1,84 @@
/*
* 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/waf-openapi/model/DescribeProtectionModuleRulesByIdListRequest.h>
using AlibabaCloud::Waf_openapi::Model::DescribeProtectionModuleRulesByIdListRequest;
DescribeProtectionModuleRulesByIdListRequest::DescribeProtectionModuleRulesByIdListRequest() :
RpcServiceRequest("waf-openapi", "2019-09-10", "DescribeProtectionModuleRulesByIdList")
{
setMethod(HttpRequest::Method::Post);
}
DescribeProtectionModuleRulesByIdListRequest::~DescribeProtectionModuleRulesByIdListRequest()
{}
std::string DescribeProtectionModuleRulesByIdListRequest::getRuleIdList()const
{
return ruleIdList_;
}
void DescribeProtectionModuleRulesByIdListRequest::setRuleIdList(const std::string& ruleIdList)
{
ruleIdList_ = ruleIdList;
setParameter("RuleIdList", ruleIdList);
}
std::string DescribeProtectionModuleRulesByIdListRequest::getResourceGroupId()const
{
return resourceGroupId_;
}
void DescribeProtectionModuleRulesByIdListRequest::setResourceGroupId(const std::string& resourceGroupId)
{
resourceGroupId_ = resourceGroupId;
setParameter("ResourceGroupId", resourceGroupId);
}
std::string DescribeProtectionModuleRulesByIdListRequest::getInstanceId()const
{
return instanceId_;
}
void DescribeProtectionModuleRulesByIdListRequest::setInstanceId(const std::string& instanceId)
{
instanceId_ = instanceId;
setParameter("InstanceId", instanceId);
}
std::string DescribeProtectionModuleRulesByIdListRequest::getSourceIp()const
{
return sourceIp_;
}
void DescribeProtectionModuleRulesByIdListRequest::setSourceIp(const std::string& sourceIp)
{
sourceIp_ = sourceIp;
setParameter("SourceIp", sourceIp);
}
std::string DescribeProtectionModuleRulesByIdListRequest::getLang()const
{
return lang_;
}
void DescribeProtectionModuleRulesByIdListRequest::setLang(const std::string& lang)
{
lang_ = lang;
setParameter("Lang", lang);
}

View File

@@ -0,0 +1,80 @@
/*
* 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/waf-openapi/model/DescribeProtectionModuleRulesByIdListResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Waf_openapi;
using namespace AlibabaCloud::Waf_openapi::Model;
DescribeProtectionModuleRulesByIdListResult::DescribeProtectionModuleRulesByIdListResult() :
ServiceResult()
{}
DescribeProtectionModuleRulesByIdListResult::DescribeProtectionModuleRulesByIdListResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeProtectionModuleRulesByIdListResult::~DescribeProtectionModuleRulesByIdListResult()
{}
void DescribeProtectionModuleRulesByIdListResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allRulesNode = value["Rules"]["Rule"];
for (auto valueRulesRule : allRulesNode)
{
Rule rulesObject;
if(!valueRulesRule["RuleId"].isNull())
rulesObject.ruleId = std::stol(valueRulesRule["RuleId"].asString());
if(!valueRulesRule["Name"].isNull())
rulesObject.name = valueRulesRule["Name"].asString();
if(!valueRulesRule["Enabled"].isNull())
rulesObject.enabled = std::stoi(valueRulesRule["Enabled"].asString());
if(!valueRulesRule["Version"].isNull())
rulesObject.version = std::stol(valueRulesRule["Version"].asString());
if(!valueRulesRule["Content"].isNull())
rulesObject.content = valueRulesRule["Content"].asString();
if(!valueRulesRule["Time"].isNull())
rulesObject.time = std::stol(valueRulesRule["Time"].asString());
if(!valueRulesRule["Status"].isNull())
rulesObject.status = std::stol(valueRulesRule["Status"].asString());
if(!valueRulesRule["Origin"].isNull())
rulesObject.origin = valueRulesRule["Origin"].asString();
if(!valueRulesRule["Scene"].isNull())
rulesObject.scene = valueRulesRule["Scene"].asString();
rules_.push_back(rulesObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
}
int DescribeProtectionModuleRulesByIdListResult::getTotalCount()const
{
return totalCount_;
}
std::vector<DescribeProtectionModuleRulesByIdListResult::Rule> DescribeProtectionModuleRulesByIdListResult::getRules()const
{
return rules_;
}

View File

@@ -71,14 +71,3 @@ void ModifyDomainClusterTypeRequest::setDomain(const std::string& domain)
setParameter("Domain", domain);
}
std::string ModifyDomainClusterTypeRequest::getRegion()const
{
return region_;
}
void ModifyDomainClusterTypeRequest::setRegion(const std::string& region)
{
region_ = region;
setParameter("Region", region);
}