Add ListTemplateVersions API.
This commit is contained in:
@@ -71,3 +71,14 @@ void CreateTemplateRequest::setTemplateName(const std::string& templateName)
|
||||
setParameter("TemplateName", templateName);
|
||||
}
|
||||
|
||||
std::string CreateTemplateRequest::getVersionName()const
|
||||
{
|
||||
return versionName_;
|
||||
}
|
||||
|
||||
void CreateTemplateRequest::setVersionName(const std::string& versionName)
|
||||
{
|
||||
versionName_ = versionName;
|
||||
setParameter("VersionName", versionName);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ void CreateTemplateResult::parse(const std::string &payload)
|
||||
_template_.hasTrigger = _templateNode["HasTrigger"].asString() == "true";
|
||||
if(!_templateNode["Tags"].isNull())
|
||||
_template_.tags = _templateNode["Tags"].asString();
|
||||
if(!value["TemplateType"].isNull())
|
||||
templateType_ = value["TemplateType"].asString();
|
||||
|
||||
}
|
||||
|
||||
@@ -74,3 +76,8 @@ CreateTemplateResult::_Template CreateTemplateResult::get_Template()const
|
||||
return _template_;
|
||||
}
|
||||
|
||||
std::string CreateTemplateResult::getTemplateType()const
|
||||
{
|
||||
return templateType_;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,17 @@ GenerateExecutionPolicyRequest::GenerateExecutionPolicyRequest() :
|
||||
GenerateExecutionPolicyRequest::~GenerateExecutionPolicyRequest()
|
||||
{}
|
||||
|
||||
std::string GenerateExecutionPolicyRequest::getTemplateVersion()const
|
||||
{
|
||||
return templateVersion_;
|
||||
}
|
||||
|
||||
void GenerateExecutionPolicyRequest::setTemplateVersion(const std::string& templateVersion)
|
||||
{
|
||||
templateVersion_ = templateVersion;
|
||||
setParameter("TemplateVersion", templateVersion);
|
||||
}
|
||||
|
||||
std::string GenerateExecutionPolicyRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
|
||||
@@ -66,6 +66,8 @@ void GetTemplateResult::parse(const std::string &payload)
|
||||
_template_.hasTrigger = _templateNode["HasTrigger"].asString() == "true";
|
||||
if(!_templateNode["Tags"].isNull())
|
||||
_template_.tags = _templateNode["Tags"].asString();
|
||||
if(!_templateNode["TemplateType"].isNull())
|
||||
_template_.templateType = _templateNode["TemplateType"].asString();
|
||||
if(!value["Content"].isNull())
|
||||
content_ = value["Content"].asString();
|
||||
|
||||
|
||||
84
oos/src/model/ListTemplateVersionsRequest.cc
Normal file
84
oos/src/model/ListTemplateVersionsRequest.cc
Normal 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/oos/model/ListTemplateVersionsRequest.h>
|
||||
|
||||
using AlibabaCloud::Oos::Model::ListTemplateVersionsRequest;
|
||||
|
||||
ListTemplateVersionsRequest::ListTemplateVersionsRequest() :
|
||||
RpcServiceRequest("oos", "2019-06-01", "ListTemplateVersions")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ListTemplateVersionsRequest::~ListTemplateVersionsRequest()
|
||||
{}
|
||||
|
||||
std::string ListTemplateVersionsRequest::getRegionId()const
|
||||
{
|
||||
return regionId_;
|
||||
}
|
||||
|
||||
void ListTemplateVersionsRequest::setRegionId(const std::string& regionId)
|
||||
{
|
||||
regionId_ = regionId;
|
||||
setParameter("RegionId", regionId);
|
||||
}
|
||||
|
||||
std::string ListTemplateVersionsRequest::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
void ListTemplateVersionsRequest::setNextToken(const std::string& nextToken)
|
||||
{
|
||||
nextToken_ = nextToken;
|
||||
setParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
int ListTemplateVersionsRequest::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
void ListTemplateVersionsRequest::setMaxResults(int maxResults)
|
||||
{
|
||||
maxResults_ = maxResults;
|
||||
setParameter("MaxResults", std::to_string(maxResults));
|
||||
}
|
||||
|
||||
std::string ListTemplateVersionsRequest::getTemplateName()const
|
||||
{
|
||||
return templateName_;
|
||||
}
|
||||
|
||||
void ListTemplateVersionsRequest::setTemplateName(const std::string& templateName)
|
||||
{
|
||||
templateName_ = templateName;
|
||||
setParameter("TemplateName", templateName);
|
||||
}
|
||||
|
||||
std::string ListTemplateVersionsRequest::getShareType()const
|
||||
{
|
||||
return shareType_;
|
||||
}
|
||||
|
||||
void ListTemplateVersionsRequest::setShareType(const std::string& shareType)
|
||||
{
|
||||
shareType_ = shareType;
|
||||
setParameter("ShareType", shareType);
|
||||
}
|
||||
|
||||
81
oos/src/model/ListTemplateVersionsResult.cc
Normal file
81
oos/src/model/ListTemplateVersionsResult.cc
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* 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/oos/model/ListTemplateVersionsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Oos;
|
||||
using namespace AlibabaCloud::Oos::Model;
|
||||
|
||||
ListTemplateVersionsResult::ListTemplateVersionsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ListTemplateVersionsResult::ListTemplateVersionsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ListTemplateVersionsResult::~ListTemplateVersionsResult()
|
||||
{}
|
||||
|
||||
void ListTemplateVersionsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allTemplateVersionsNode = value["TemplateVersions"]["TemplateVersion"];
|
||||
for (auto valueTemplateVersionsTemplateVersion : allTemplateVersionsNode)
|
||||
{
|
||||
TemplateVersion templateVersionsObject;
|
||||
if(!valueTemplateVersionsTemplateVersion["Description"].isNull())
|
||||
templateVersionsObject.description = valueTemplateVersionsTemplateVersion["Description"].asString();
|
||||
if(!valueTemplateVersionsTemplateVersion["TemplateFormat"].isNull())
|
||||
templateVersionsObject.templateFormat = valueTemplateVersionsTemplateVersion["TemplateFormat"].asString();
|
||||
if(!valueTemplateVersionsTemplateVersion["TemplateVersion"].isNull())
|
||||
templateVersionsObject.templateVersion = valueTemplateVersionsTemplateVersion["TemplateVersion"].asString();
|
||||
if(!valueTemplateVersionsTemplateVersion["UpdatedDate"].isNull())
|
||||
templateVersionsObject.updatedDate = valueTemplateVersionsTemplateVersion["UpdatedDate"].asString();
|
||||
if(!valueTemplateVersionsTemplateVersion["UpdatedBy"].isNull())
|
||||
templateVersionsObject.updatedBy = valueTemplateVersionsTemplateVersion["UpdatedBy"].asString();
|
||||
if(!valueTemplateVersionsTemplateVersion["VersionName"].isNull())
|
||||
templateVersionsObject.versionName = valueTemplateVersionsTemplateVersion["VersionName"].asString();
|
||||
templateVersions_.push_back(templateVersionsObject);
|
||||
}
|
||||
if(!value["MaxResults"].isNull())
|
||||
maxResults_ = std::stoi(value["MaxResults"].asString());
|
||||
if(!value["NextToken"].isNull())
|
||||
nextToken_ = value["NextToken"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string ListTemplateVersionsResult::getNextToken()const
|
||||
{
|
||||
return nextToken_;
|
||||
}
|
||||
|
||||
int ListTemplateVersionsResult::getMaxResults()const
|
||||
{
|
||||
return maxResults_;
|
||||
}
|
||||
|
||||
std::vector<ListTemplateVersionsResult::TemplateVersion> ListTemplateVersionsResult::getTemplateVersions()const
|
||||
{
|
||||
return templateVersions_;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,17 @@ void ListTemplatesRequest::setNextToken(const std::string& nextToken)
|
||||
setParameter("NextToken", nextToken);
|
||||
}
|
||||
|
||||
std::string ListTemplatesRequest::getTemplateType()const
|
||||
{
|
||||
return templateType_;
|
||||
}
|
||||
|
||||
void ListTemplatesRequest::setTemplateType(const std::string& templateType)
|
||||
{
|
||||
templateType_ = templateType;
|
||||
setParameter("TemplateType", templateType);
|
||||
}
|
||||
|
||||
std::string ListTemplatesRequest::getTemplateName()const
|
||||
{
|
||||
return templateName_;
|
||||
|
||||
@@ -75,6 +75,8 @@ void ListTemplatesResult::parse(const std::string &payload)
|
||||
templatesObject.tags = valueTemplatesTemplate["Tags"].asString();
|
||||
if(!valueTemplatesTemplate["Category"].isNull())
|
||||
templatesObject.category = valueTemplatesTemplate["Category"].asString();
|
||||
if(!valueTemplatesTemplate["TemplateType"].isNull())
|
||||
templatesObject.templateType = valueTemplatesTemplate["TemplateType"].asString();
|
||||
templates_.push_back(templatesObject);
|
||||
}
|
||||
if(!value["MaxResults"].isNull())
|
||||
|
||||
@@ -71,3 +71,14 @@ void UpdateTemplateRequest::setTemplateName(const std::string& templateName)
|
||||
setParameter("TemplateName", templateName);
|
||||
}
|
||||
|
||||
std::string UpdateTemplateRequest::getVersionName()const
|
||||
{
|
||||
return versionName_;
|
||||
}
|
||||
|
||||
void UpdateTemplateRequest::setVersionName(const std::string& versionName)
|
||||
{
|
||||
versionName_ = versionName;
|
||||
setParameter("VersionName", versionName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user