Update domain API.

This commit is contained in:
sdk-team
2020-09-27 09:25:54 +00:00
parent b31d71fa81
commit f2caf37a92
12 changed files with 308 additions and 22 deletions

View File

@@ -1,3 +1,6 @@
2020-09-27 Version: patch
- Update domain API.
2020-09-27 Version: patch
- Support Open Service API.

View File

@@ -115,6 +115,8 @@ set(cdn_public_header_model
include/alibabacloud/cdn/model/DescribeCdnUserQuotaResult.h
include/alibabacloud/cdn/model/DescribeCdnUserResourcePackageRequest.h
include/alibabacloud/cdn/model/DescribeCdnUserResourcePackageResult.h
include/alibabacloud/cdn/model/DescribeCdnWafDomainRequest.h
include/alibabacloud/cdn/model/DescribeCdnWafDomainResult.h
include/alibabacloud/cdn/model/DescribeCertificateInfoByIDRequest.h
include/alibabacloud/cdn/model/DescribeCertificateInfoByIDResult.h
include/alibabacloud/cdn/model/DescribeConfigOfVersionRequest.h
@@ -510,6 +512,8 @@ set(cdn_src
src/model/DescribeCdnUserQuotaResult.cc
src/model/DescribeCdnUserResourcePackageRequest.cc
src/model/DescribeCdnUserResourcePackageResult.cc
src/model/DescribeCdnWafDomainRequest.cc
src/model/DescribeCdnWafDomainResult.cc
src/model/DescribeCertificateInfoByIDRequest.cc
src/model/DescribeCertificateInfoByIDResult.cc
src/model/DescribeConfigOfVersionRequest.cc

View File

@@ -116,6 +116,8 @@
#include "model/DescribeCdnUserQuotaResult.h"
#include "model/DescribeCdnUserResourcePackageRequest.h"
#include "model/DescribeCdnUserResourcePackageResult.h"
#include "model/DescribeCdnWafDomainRequest.h"
#include "model/DescribeCdnWafDomainResult.h"
#include "model/DescribeCertificateInfoByIDRequest.h"
#include "model/DescribeCertificateInfoByIDResult.h"
#include "model/DescribeConfigOfVersionRequest.h"
@@ -564,6 +566,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::DescribeCdnUserResourcePackageResult> DescribeCdnUserResourcePackageOutcome;
typedef std::future<DescribeCdnUserResourcePackageOutcome> DescribeCdnUserResourcePackageOutcomeCallable;
typedef std::function<void(const CdnClient*, const Model::DescribeCdnUserResourcePackageRequest&, const DescribeCdnUserResourcePackageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeCdnUserResourcePackageAsyncHandler;
typedef Outcome<Error, Model::DescribeCdnWafDomainResult> DescribeCdnWafDomainOutcome;
typedef std::future<DescribeCdnWafDomainOutcome> DescribeCdnWafDomainOutcomeCallable;
typedef std::function<void(const CdnClient*, const Model::DescribeCdnWafDomainRequest&, const DescribeCdnWafDomainOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeCdnWafDomainAsyncHandler;
typedef Outcome<Error, Model::DescribeCertificateInfoByIDResult> DescribeCertificateInfoByIDOutcome;
typedef std::future<DescribeCertificateInfoByIDOutcome> DescribeCertificateInfoByIDOutcomeCallable;
typedef std::function<void(const CdnClient*, const Model::DescribeCertificateInfoByIDRequest&, const DescribeCertificateInfoByIDOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeCertificateInfoByIDAsyncHandler;
@@ -1157,6 +1162,9 @@ namespace AlibabaCloud
DescribeCdnUserResourcePackageOutcome describeCdnUserResourcePackage(const Model::DescribeCdnUserResourcePackageRequest &request)const;
void describeCdnUserResourcePackageAsync(const Model::DescribeCdnUserResourcePackageRequest& request, const DescribeCdnUserResourcePackageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeCdnUserResourcePackageOutcomeCallable describeCdnUserResourcePackageCallable(const Model::DescribeCdnUserResourcePackageRequest& request) const;
DescribeCdnWafDomainOutcome describeCdnWafDomain(const Model::DescribeCdnWafDomainRequest &request)const;
void describeCdnWafDomainAsync(const Model::DescribeCdnWafDomainRequest& request, const DescribeCdnWafDomainAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeCdnWafDomainOutcomeCallable describeCdnWafDomainCallable(const Model::DescribeCdnWafDomainRequest& request) const;
DescribeCertificateInfoByIDOutcome describeCertificateInfoByID(const Model::DescribeCertificateInfoByIDRequest &request)const;
void describeCertificateInfoByIDAsync(const Model::DescribeCertificateInfoByIDRequest& request, const DescribeCertificateInfoByIDAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeCertificateInfoByIDOutcomeCallable describeCertificateInfoByIDCallable(const Model::DescribeCertificateInfoByIDRequest& request) const;

View File

@@ -0,0 +1,54 @@
/*
* 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.
*/
#ifndef ALIBABACLOUD_CDN_MODEL_DESCRIBECDNWAFDOMAINREQUEST_H_
#define ALIBABACLOUD_CDN_MODEL_DESCRIBECDNWAFDOMAINREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/cdn/CdnExport.h>
namespace AlibabaCloud
{
namespace Cdn
{
namespace Model
{
class ALIBABACLOUD_CDN_EXPORT DescribeCdnWafDomainRequest : public RpcServiceRequest
{
public:
DescribeCdnWafDomainRequest();
~DescribeCdnWafDomainRequest();
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
std::string getDomainName()const;
void setDomainName(const std::string& domainName);
long getOwnerId()const;
void setOwnerId(long ownerId);
private:
std::string regionId_;
std::string domainName_;
long ownerId_;
};
}
}
}
#endif // !ALIBABACLOUD_CDN_MODEL_DESCRIBECDNWAFDOMAINREQUEST_H_

View File

@@ -0,0 +1,61 @@
/*
* 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.
*/
#ifndef ALIBABACLOUD_CDN_MODEL_DESCRIBECDNWAFDOMAINRESULT_H_
#define ALIBABACLOUD_CDN_MODEL_DESCRIBECDNWAFDOMAINRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/cdn/CdnExport.h>
namespace AlibabaCloud
{
namespace Cdn
{
namespace Model
{
class ALIBABACLOUD_CDN_EXPORT DescribeCdnWafDomainResult : public ServiceResult
{
public:
struct OutPutDomain
{
std::string status;
std::string aclStatus;
std::string ccStatus;
std::string domain;
std::string wafStatus;
};
DescribeCdnWafDomainResult();
explicit DescribeCdnWafDomainResult(const std::string &payload);
~DescribeCdnWafDomainResult();
int getTotalCount()const;
std::vector<OutPutDomain> getOutPutDomains()const;
protected:
void parse(const std::string &payload);
private:
int totalCount_;
std::vector<OutPutDomain> outPutDomains_;
};
}
}
}
#endif // !ALIBABACLOUD_CDN_MODEL_DESCRIBECDNWAFDOMAINRESULT_H_

View File

@@ -41,8 +41,6 @@ namespace AlibabaCloud
TagResourcesRequest();
~TagResourcesRequest();
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
std::vector<Tag> getTag()const;
void setTag(const std::vector<Tag>& tag);
std::vector<std::string> getResourceId()const;
@@ -53,7 +51,6 @@ namespace AlibabaCloud
void setResourceType(const std::string& resourceType);
private:
std::string regionId_;
std::vector<Tag> tag_;
std::vector<std::string> resourceId_;
long ownerId_;

View File

@@ -35,8 +35,8 @@ namespace AlibabaCloud
UntagResourcesRequest();
~UntagResourcesRequest();
std::string getRegionId()const;
void setRegionId(const std::string& regionId);
bool getAll()const;
void setAll(bool all);
std::vector<std::string> getResourceId()const;
void setResourceId(const std::vector<std::string>& resourceId);
long getOwnerId()const;
@@ -47,7 +47,7 @@ namespace AlibabaCloud
void setTagKey(const std::vector<std::string>& tagKey);
private:
std::string regionId_;
bool all_;
std::vector<std::string> resourceId_;
long ownerId_;
std::string resourceType_;

View File

@@ -1743,6 +1743,42 @@ CdnClient::DescribeCdnUserResourcePackageOutcomeCallable CdnClient::describeCdnU
return task->get_future();
}
CdnClient::DescribeCdnWafDomainOutcome CdnClient::describeCdnWafDomain(const DescribeCdnWafDomainRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeCdnWafDomainOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeCdnWafDomainOutcome(DescribeCdnWafDomainResult(outcome.result()));
else
return DescribeCdnWafDomainOutcome(outcome.error());
}
void CdnClient::describeCdnWafDomainAsync(const DescribeCdnWafDomainRequest& request, const DescribeCdnWafDomainAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeCdnWafDomain(request), context);
};
asyncExecute(new Runnable(fn));
}
CdnClient::DescribeCdnWafDomainOutcomeCallable CdnClient::describeCdnWafDomainCallable(const DescribeCdnWafDomainRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeCdnWafDomainOutcome()>>(
[this, request]()
{
return this->describeCdnWafDomain(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CdnClient::DescribeCertificateInfoByIDOutcome CdnClient::describeCertificateInfoByID(const DescribeCertificateInfoByIDRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,62 @@
/*
* 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/cdn/model/DescribeCdnWafDomainRequest.h>
using AlibabaCloud::Cdn::Model::DescribeCdnWafDomainRequest;
DescribeCdnWafDomainRequest::DescribeCdnWafDomainRequest() :
RpcServiceRequest("cdn", "2018-05-10", "DescribeCdnWafDomain")
{
setMethod(HttpRequest::Method::Post);
}
DescribeCdnWafDomainRequest::~DescribeCdnWafDomainRequest()
{}
std::string DescribeCdnWafDomainRequest::getRegionId()const
{
return regionId_;
}
void DescribeCdnWafDomainRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::string DescribeCdnWafDomainRequest::getDomainName()const
{
return domainName_;
}
void DescribeCdnWafDomainRequest::setDomainName(const std::string& domainName)
{
domainName_ = domainName;
setParameter("DomainName", domainName);
}
long DescribeCdnWafDomainRequest::getOwnerId()const
{
return ownerId_;
}
void DescribeCdnWafDomainRequest::setOwnerId(long ownerId)
{
ownerId_ = ownerId;
setParameter("OwnerId", std::to_string(ownerId));
}

View File

@@ -0,0 +1,72 @@
/*
* 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/cdn/model/DescribeCdnWafDomainResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Cdn;
using namespace AlibabaCloud::Cdn::Model;
DescribeCdnWafDomainResult::DescribeCdnWafDomainResult() :
ServiceResult()
{}
DescribeCdnWafDomainResult::DescribeCdnWafDomainResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DescribeCdnWafDomainResult::~DescribeCdnWafDomainResult()
{}
void DescribeCdnWafDomainResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allOutPutDomainsNode = value["OutPutDomains"]["OutPutDomain"];
for (auto valueOutPutDomainsOutPutDomain : allOutPutDomainsNode)
{
OutPutDomain outPutDomainsObject;
if(!valueOutPutDomainsOutPutDomain["Status"].isNull())
outPutDomainsObject.status = valueOutPutDomainsOutPutDomain["Status"].asString();
if(!valueOutPutDomainsOutPutDomain["Domain"].isNull())
outPutDomainsObject.domain = valueOutPutDomainsOutPutDomain["Domain"].asString();
if(!valueOutPutDomainsOutPutDomain["WafStatus"].isNull())
outPutDomainsObject.wafStatus = valueOutPutDomainsOutPutDomain["WafStatus"].asString();
if(!valueOutPutDomainsOutPutDomain["CcStatus"].isNull())
outPutDomainsObject.ccStatus = valueOutPutDomainsOutPutDomain["CcStatus"].asString();
if(!valueOutPutDomainsOutPutDomain["AclStatus"].isNull())
outPutDomainsObject.aclStatus = valueOutPutDomainsOutPutDomain["AclStatus"].asString();
outPutDomains_.push_back(outPutDomainsObject);
}
if(!value["TotalCount"].isNull())
totalCount_ = std::stoi(value["TotalCount"].asString());
}
int DescribeCdnWafDomainResult::getTotalCount()const
{
return totalCount_;
}
std::vector<DescribeCdnWafDomainResult::OutPutDomain> DescribeCdnWafDomainResult::getOutPutDomains()const
{
return outPutDomains_;
}

View File

@@ -27,17 +27,6 @@ TagResourcesRequest::TagResourcesRequest() :
TagResourcesRequest::~TagResourcesRequest()
{}
std::string TagResourcesRequest::getRegionId()const
{
return regionId_;
}
void TagResourcesRequest::setRegionId(const std::string& regionId)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
}
std::vector<TagResourcesRequest::Tag> TagResourcesRequest::getTag()const
{
return tag_;

View File

@@ -27,15 +27,15 @@ UntagResourcesRequest::UntagResourcesRequest() :
UntagResourcesRequest::~UntagResourcesRequest()
{}
std::string UntagResourcesRequest::getRegionId()const
bool UntagResourcesRequest::getAll()const
{
return regionId_;
return all_;
}
void UntagResourcesRequest::setRegionId(const std::string& regionId)
void UntagResourcesRequest::setAll(bool all)
{
regionId_ = regionId;
setParameter("RegionId", regionId);
all_ = all;
setParameter("All", all ? "true" : "false");
}
std::vector<std::string> UntagResourcesRequest::getResourceId()const