Add GetRepositoryTagV2 and DeleteRepositoryTagV2 API.

This commit is contained in:
sdk-team
2021-03-03 13:47:48 +00:00
parent 11e91aaf29
commit b38385d35f
70 changed files with 757 additions and 0 deletions

View File

@@ -807,6 +807,42 @@ CodeupClient::DeleteRepositoryTagOutcomeCallable CodeupClient::deleteRepositoryT
return task->get_future();
}
CodeupClient::DeleteRepositoryTagV2Outcome CodeupClient::deleteRepositoryTagV2(const DeleteRepositoryTagV2Request &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteRepositoryTagV2Outcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteRepositoryTagV2Outcome(DeleteRepositoryTagV2Result(outcome.result()));
else
return DeleteRepositoryTagV2Outcome(outcome.error());
}
void CodeupClient::deleteRepositoryTagV2Async(const DeleteRepositoryTagV2Request& request, const DeleteRepositoryTagV2AsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteRepositoryTagV2(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::DeleteRepositoryTagV2OutcomeCallable CodeupClient::deleteRepositoryTagV2Callable(const DeleteRepositoryTagV2Request &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteRepositoryTagV2Outcome()>>(
[this, request]()
{
return this->deleteRepositoryTagV2(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::DeleteRepositoryWebhookOutcome CodeupClient::deleteRepositoryWebhook(const DeleteRepositoryWebhookRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1239,6 +1275,42 @@ CodeupClient::GetRepositoryTagOutcomeCallable CodeupClient::getRepositoryTagCall
return task->get_future();
}
CodeupClient::GetRepositoryTagV2Outcome CodeupClient::getRepositoryTagV2(const GetRepositoryTagV2Request &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetRepositoryTagV2Outcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetRepositoryTagV2Outcome(GetRepositoryTagV2Result(outcome.result()));
else
return GetRepositoryTagV2Outcome(outcome.error());
}
void CodeupClient::getRepositoryTagV2Async(const GetRepositoryTagV2Request& request, const GetRepositoryTagV2AsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getRepositoryTagV2(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::GetRepositoryTagV2OutcomeCallable CodeupClient::getRepositoryTagV2Callable(const GetRepositoryTagV2Request &request) const
{
auto task = std::make_shared<std::packaged_task<GetRepositoryTagV2Outcome()>>(
[this, request]()
{
return this->getRepositoryTagV2(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::GetUserInfoOutcome CodeupClient::getUserInfo(const GetUserInfoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,74 @@
/*
* 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/codeup/model/DeleteRepositoryTagV2Request.h>
using AlibabaCloud::Codeup::Model::DeleteRepositoryTagV2Request;
DeleteRepositoryTagV2Request::DeleteRepositoryTagV2Request() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/projects/[ProjectId]/repository/tag/delete");
setMethod(HttpRequest::Method::Delete);
}
DeleteRepositoryTagV2Request::~DeleteRepositoryTagV2Request()
{}
std::string DeleteRepositoryTagV2Request::getOrganizationId()const
{
return organizationId_;
}
void DeleteRepositoryTagV2Request::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string DeleteRepositoryTagV2Request::getTagName()const
{
return tagName_;
}
void DeleteRepositoryTagV2Request::setTagName(const std::string& tagName)
{
tagName_ = tagName;
setParameter("TagName", tagName);
}
std::string DeleteRepositoryTagV2Request::getAccessToken()const
{
return accessToken_;
}
void DeleteRepositoryTagV2Request::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}
long DeleteRepositoryTagV2Request::getProjectId()const
{
return projectId_;
}
void DeleteRepositoryTagV2Request::setProjectId(long projectId)
{
projectId_ = projectId;
setParameter("ProjectId", std::to_string(projectId));
}

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/codeup/model/DeleteRepositoryTagV2Result.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
DeleteRepositoryTagV2Result::DeleteRepositoryTagV2Result() :
ServiceResult()
{}
DeleteRepositoryTagV2Result::DeleteRepositoryTagV2Result(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteRepositoryTagV2Result::~DeleteRepositoryTagV2Result()
{}
void DeleteRepositoryTagV2Result::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto resultNode = value["Result"];
if(!resultNode["TagName"].isNull())
result_.tagName = resultNode["TagName"].asString();
if(!value["ErrorCode"].isNull())
errorCode_ = value["ErrorCode"].asString();
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string DeleteRepositoryTagV2Result::getErrorCode()const
{
return errorCode_;
}
std::string DeleteRepositoryTagV2Result::getErrorMessage()const
{
return errorMessage_;
}
bool DeleteRepositoryTagV2Result::getSuccess()const
{
return success_;
}
DeleteRepositoryTagV2Result::Result DeleteRepositoryTagV2Result::getResult()const
{
return result_;
}

View File

@@ -0,0 +1,74 @@
/*
* 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/codeup/model/GetRepositoryTagV2Request.h>
using AlibabaCloud::Codeup::Model::GetRepositoryTagV2Request;
GetRepositoryTagV2Request::GetRepositoryTagV2Request() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/projects/[ProjectId]/repository/tag/info");
setMethod(HttpRequest::Method::Get);
}
GetRepositoryTagV2Request::~GetRepositoryTagV2Request()
{}
std::string GetRepositoryTagV2Request::getOrganizationId()const
{
return organizationId_;
}
void GetRepositoryTagV2Request::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string GetRepositoryTagV2Request::getTagName()const
{
return tagName_;
}
void GetRepositoryTagV2Request::setTagName(const std::string& tagName)
{
tagName_ = tagName;
setParameter("TagName", tagName);
}
std::string GetRepositoryTagV2Request::getAccessToken()const
{
return accessToken_;
}
void GetRepositoryTagV2Request::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}
long GetRepositoryTagV2Request::getProjectId()const
{
return projectId_;
}
void GetRepositoryTagV2Request::setProjectId(long projectId)
{
projectId_ = projectId;
setParameter("ProjectId", std::to_string(projectId));
}

View File

@@ -0,0 +1,113 @@
/*
* 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/codeup/model/GetRepositoryTagV2Result.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
GetRepositoryTagV2Result::GetRepositoryTagV2Result() :
ServiceResult()
{}
GetRepositoryTagV2Result::GetRepositoryTagV2Result(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
GetRepositoryTagV2Result::~GetRepositoryTagV2Result()
{}
void GetRepositoryTagV2Result::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto resultNode = value["Result"];
if(!resultNode["Id"].isNull())
result_.id = resultNode["Id"].asString();
if(!resultNode["Message"].isNull())
result_.message = resultNode["Message"].asString();
if(!resultNode["Name"].isNull())
result_.name = resultNode["Name"].asString();
auto commitNode = resultNode["Commit"];
if(!commitNode["AuthorEmail"].isNull())
result_.commit.authorEmail = commitNode["AuthorEmail"].asString();
if(!commitNode["AuthorName"].isNull())
result_.commit.authorName = commitNode["AuthorName"].asString();
if(!commitNode["AuthoredDate"].isNull())
result_.commit.authoredDate = commitNode["AuthoredDate"].asString();
if(!commitNode["CommittedDate"].isNull())
result_.commit.committedDate = commitNode["CommittedDate"].asString();
if(!commitNode["CommitterEmail"].isNull())
result_.commit.committerEmail = commitNode["CommitterEmail"].asString();
if(!commitNode["CommitterName"].isNull())
result_.commit.committerName = commitNode["CommitterName"].asString();
if(!commitNode["CreatedAt"].isNull())
result_.commit.createdAt = commitNode["CreatedAt"].asString();
if(!commitNode["Id"].isNull())
result_.commit.id = commitNode["Id"].asString();
if(!commitNode["Message"].isNull())
result_.commit.message = commitNode["Message"].asString();
if(!commitNode["ShortId"].isNull())
result_.commit.shortId = commitNode["ShortId"].asString();
if(!commitNode["Title"].isNull())
result_.commit.title = commitNode["Title"].asString();
auto signature1Node = commitNode["Signature"];
if(!signature1Node["GpgKeyId"].isNull())
result_.commit.signature1.gpgKeyId = signature1Node["GpgKeyId"].asString();
if(!signature1Node["VerificationStatus"].isNull())
result_.commit.signature1.verificationStatus = signature1Node["VerificationStatus"].asString();
auto allParentIds = commitNode["ParentIds"]["ParentIds"];
for (auto value : allParentIds)
result_.commit.parentIds.push_back(value.asString());
auto signatureNode = resultNode["Signature"];
if(!signatureNode["GpgKeyId"].isNull())
result_.signature.gpgKeyId = signatureNode["GpgKeyId"].asString();
if(!signatureNode["VerificationStatus"].isNull())
result_.signature.verificationStatus = signatureNode["VerificationStatus"].asString();
if(!value["ErrorCode"].isNull())
errorCode_ = value["ErrorCode"].asString();
if(!value["ErrorMessage"].isNull())
errorMessage_ = value["ErrorMessage"].asString();
if(!value["Success"].isNull())
success_ = value["Success"].asString() == "true";
}
std::string GetRepositoryTagV2Result::getErrorCode()const
{
return errorCode_;
}
std::string GetRepositoryTagV2Result::getErrorMessage()const
{
return errorMessage_;
}
bool GetRepositoryTagV2Result::getSuccess()const
{
return success_;
}
GetRepositoryTagV2Result::Result GetRepositoryTagV2Result::getResult()const
{
return result_;
}