Add ListMergeRequests api.

This commit is contained in:
sdk-team
2021-01-18 03:54:49 +00:00
parent 4d618db251
commit 76821f71df
30 changed files with 2449 additions and 0 deletions

View File

@@ -303,6 +303,42 @@ CodeupClient::CreateRepositoryOutcomeCallable CodeupClient::createRepositoryCall
return task->get_future();
}
CodeupClient::CreateRepositoryDeployKeyOutcome CodeupClient::createRepositoryDeployKey(const CreateRepositoryDeployKeyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateRepositoryDeployKeyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateRepositoryDeployKeyOutcome(CreateRepositoryDeployKeyResult(outcome.result()));
else
return CreateRepositoryDeployKeyOutcome(outcome.error());
}
void CodeupClient::createRepositoryDeployKeyAsync(const CreateRepositoryDeployKeyRequest& request, const CreateRepositoryDeployKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createRepositoryDeployKey(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::CreateRepositoryDeployKeyOutcomeCallable CodeupClient::createRepositoryDeployKeyCallable(const CreateRepositoryDeployKeyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateRepositoryDeployKeyOutcome()>>(
[this, request]()
{
return this->createRepositoryDeployKey(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::CreateRepositoryGroupOutcome CodeupClient::createRepositoryGroup(const CreateRepositoryGroupRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -339,6 +375,42 @@ CodeupClient::CreateRepositoryGroupOutcomeCallable CodeupClient::createRepositor
return task->get_future();
}
CodeupClient::CreateRepositoryProtectedBranchOutcome CodeupClient::createRepositoryProtectedBranch(const CreateRepositoryProtectedBranchRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateRepositoryProtectedBranchOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateRepositoryProtectedBranchOutcome(CreateRepositoryProtectedBranchResult(outcome.result()));
else
return CreateRepositoryProtectedBranchOutcome(outcome.error());
}
void CodeupClient::createRepositoryProtectedBranchAsync(const CreateRepositoryProtectedBranchRequest& request, const CreateRepositoryProtectedBranchAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createRepositoryProtectedBranch(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::CreateRepositoryProtectedBranchOutcomeCallable CodeupClient::createRepositoryProtectedBranchCallable(const CreateRepositoryProtectedBranchRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateRepositoryProtectedBranchOutcome()>>(
[this, request]()
{
return this->createRepositoryProtectedBranch(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::CreateTagOutcome CodeupClient::createTag(const CreateTagRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -591,6 +663,42 @@ CodeupClient::DeleteRepositoryMemberOutcomeCallable CodeupClient::deleteReposito
return task->get_future();
}
CodeupClient::DeleteRepositoryProtectedBranchOutcome CodeupClient::deleteRepositoryProtectedBranch(const DeleteRepositoryProtectedBranchRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteRepositoryProtectedBranchOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteRepositoryProtectedBranchOutcome(DeleteRepositoryProtectedBranchResult(outcome.result()));
else
return DeleteRepositoryProtectedBranchOutcome(outcome.error());
}
void CodeupClient::deleteRepositoryProtectedBranchAsync(const DeleteRepositoryProtectedBranchRequest& request, const DeleteRepositoryProtectedBranchAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteRepositoryProtectedBranch(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::DeleteRepositoryProtectedBranchOutcomeCallable CodeupClient::deleteRepositoryProtectedBranchCallable(const DeleteRepositoryProtectedBranchRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteRepositoryProtectedBranchOutcome()>>(
[this, request]()
{
return this->deleteRepositoryProtectedBranch(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::DeleteRepositoryTagOutcome CodeupClient::deleteRepositoryTag(const DeleteRepositoryTagRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -663,6 +771,42 @@ CodeupClient::DeleteRepositoryWebhookOutcomeCallable CodeupClient::deleteReposit
return task->get_future();
}
CodeupClient::EnableRepositoryDeployKeyOutcome CodeupClient::enableRepositoryDeployKey(const EnableRepositoryDeployKeyRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return EnableRepositoryDeployKeyOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return EnableRepositoryDeployKeyOutcome(EnableRepositoryDeployKeyResult(outcome.result()));
else
return EnableRepositoryDeployKeyOutcome(outcome.error());
}
void CodeupClient::enableRepositoryDeployKeyAsync(const EnableRepositoryDeployKeyRequest& request, const EnableRepositoryDeployKeyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, enableRepositoryDeployKey(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::EnableRepositoryDeployKeyOutcomeCallable CodeupClient::enableRepositoryDeployKeyCallable(const EnableRepositoryDeployKeyRequest &request) const
{
auto task = std::make_shared<std::packaged_task<EnableRepositoryDeployKeyOutcome()>>(
[this, request]()
{
return this->enableRepositoryDeployKey(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::GetBranchInfoOutcome CodeupClient::getBranchInfo(const GetBranchInfoRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1059,6 +1203,42 @@ CodeupClient::ListGroupsOutcomeCallable CodeupClient::listGroupsCallable(const L
return task->get_future();
}
CodeupClient::ListMergeRequestsOutcome CodeupClient::listMergeRequests(const ListMergeRequestsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListMergeRequestsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListMergeRequestsOutcome(ListMergeRequestsResult(outcome.result()));
else
return ListMergeRequestsOutcome(outcome.error());
}
void CodeupClient::listMergeRequestsAsync(const ListMergeRequestsRequest& request, const ListMergeRequestsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listMergeRequests(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::ListMergeRequestsOutcomeCallable CodeupClient::listMergeRequestsCallable(const ListMergeRequestsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListMergeRequestsOutcome()>>(
[this, request]()
{
return this->listMergeRequests(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::ListOrganizationsOutcome CodeupClient::listOrganizations(const ListOrganizationsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1419,6 +1599,42 @@ CodeupClient::UpdateGroupMemberOutcomeCallable CodeupClient::updateGroupMemberCa
return task->get_future();
}
CodeupClient::UpdateRepositoryOutcome CodeupClient::updateRepository(const UpdateRepositoryRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UpdateRepositoryOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UpdateRepositoryOutcome(UpdateRepositoryResult(outcome.result()));
else
return UpdateRepositoryOutcome(outcome.error());
}
void CodeupClient::updateRepositoryAsync(const UpdateRepositoryRequest& request, const UpdateRepositoryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, updateRepository(request), context);
};
asyncExecute(new Runnable(fn));
}
CodeupClient::UpdateRepositoryOutcomeCallable CodeupClient::updateRepositoryCallable(const UpdateRepositoryRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UpdateRepositoryOutcome()>>(
[this, request]()
{
return this->updateRepository(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
CodeupClient::UpdateRepositoryMemberOutcome CodeupClient::updateRepositoryMember(const UpdateRepositoryMemberRequest &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/CreateRepositoryDeployKeyRequest.h>
using AlibabaCloud::Codeup::Model::CreateRepositoryDeployKeyRequest;
CreateRepositoryDeployKeyRequest::CreateRepositoryDeployKeyRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/projects/[ProjectId]/keys");
setMethod(HttpRequest::Method::Post);
}
CreateRepositoryDeployKeyRequest::~CreateRepositoryDeployKeyRequest()
{}
std::string CreateRepositoryDeployKeyRequest::getOrganizationId()const
{
return organizationId_;
}
void CreateRepositoryDeployKeyRequest::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string CreateRepositoryDeployKeyRequest::getSubUserId()const
{
return subUserId_;
}
void CreateRepositoryDeployKeyRequest::setSubUserId(const std::string& subUserId)
{
subUserId_ = subUserId;
setParameter("SubUserId", subUserId);
}
std::string CreateRepositoryDeployKeyRequest::getAccessToken()const
{
return accessToken_;
}
void CreateRepositoryDeployKeyRequest::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}
long CreateRepositoryDeployKeyRequest::getProjectId()const
{
return projectId_;
}
void CreateRepositoryDeployKeyRequest::setProjectId(long projectId)
{
projectId_ = projectId;
setParameter("ProjectId", std::to_string(projectId));
}

View 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/codeup/model/CreateRepositoryDeployKeyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
CreateRepositoryDeployKeyResult::CreateRepositoryDeployKeyResult() :
ServiceResult()
{}
CreateRepositoryDeployKeyResult::CreateRepositoryDeployKeyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateRepositoryDeployKeyResult::~CreateRepositoryDeployKeyResult()
{}
void CreateRepositoryDeployKeyResult::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 = std::stol(resultNode["Id"].asString());
if(!resultNode["Title"].isNull())
result_.title = resultNode["Title"].asString();
if(!resultNode["Key"].isNull())
result_.key = resultNode["Key"].asString();
if(!resultNode["FingerPrint"].isNull())
result_.fingerPrint = resultNode["FingerPrint"].asString();
if(!resultNode["CreatedAt"].isNull())
result_.createdAt = resultNode["CreatedAt"].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 CreateRepositoryDeployKeyResult::getErrorCode()const
{
return errorCode_;
}
std::string CreateRepositoryDeployKeyResult::getErrorMessage()const
{
return errorMessage_;
}
bool CreateRepositoryDeployKeyResult::getSuccess()const
{
return success_;
}
CreateRepositoryDeployKeyResult::Result CreateRepositoryDeployKeyResult::getResult()const
{
return result_;
}

View File

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

View File

@@ -0,0 +1,124 @@
/*
* 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/CreateRepositoryProtectedBranchResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
CreateRepositoryProtectedBranchResult::CreateRepositoryProtectedBranchResult() :
ServiceResult()
{}
CreateRepositoryProtectedBranchResult::CreateRepositoryProtectedBranchResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
CreateRepositoryProtectedBranchResult::~CreateRepositoryProtectedBranchResult()
{}
void CreateRepositoryProtectedBranchResult::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 = std::stol(resultNode["Id"].asString());
if(!resultNode["Branch"].isNull())
result_.branch = resultNode["Branch"].asString();
auto mergeRequestSettingNode = resultNode["MergeRequestSetting"];
if(!mergeRequestSettingNode["Required"].isNull())
result_.mergeRequestSetting.required = mergeRequestSettingNode["Required"].asString() == "true";
if(!mergeRequestSettingNode["MergeRequestMode"].isNull())
result_.mergeRequestSetting.mergeRequestMode = mergeRequestSettingNode["MergeRequestMode"].asString();
if(!mergeRequestSettingNode["AllowSelfApproval"].isNull())
result_.mergeRequestSetting.allowSelfApproval = mergeRequestSettingNode["AllowSelfApproval"].asString() == "true";
if(!mergeRequestSettingNode["IsRequireDiscussionProcessed"].isNull())
result_.mergeRequestSetting.isRequireDiscussionProcessed = mergeRequestSettingNode["IsRequireDiscussionProcessed"].asString() == "true";
if(!mergeRequestSettingNode["IsResetApprovalWhenNewPush"].isNull())
result_.mergeRequestSetting.isResetApprovalWhenNewPush = mergeRequestSettingNode["IsResetApprovalWhenNewPush"].asString() == "true";
if(!mergeRequestSettingNode["MinimualApproval"].isNull())
result_.mergeRequestSetting.minimualApproval = std::stoi(mergeRequestSettingNode["MinimualApproval"].asString());
auto allAllowMergeRequestRoles = mergeRequestSettingNode["AllowMergeRequestRoles"]["AllowMergeRequestRoles"];
for (auto value : allAllowMergeRequestRoles)
result_.mergeRequestSetting.allowMergeRequestRoles.push_back(value.asString());
auto allDefaultAssignees = mergeRequestSettingNode["DefaultAssignees"]["DefaultAssignees"];
for (auto value : allDefaultAssignees)
result_.mergeRequestSetting.defaultAssignees.push_back(value.asString());
auto testSettingNode = resultNode["TestSetting"];
if(!testSettingNode["Required"].isNull())
result_.testSetting.required = testSettingNode["Required"].asString() == "true";
auto codingGuidelinesDetectionNode = testSettingNode["CodingGuidelinesDetection"];
if(!codingGuidelinesDetectionNode["Enabled"].isNull())
result_.testSetting.codingGuidelinesDetection.enabled = codingGuidelinesDetectionNode["Enabled"].asString() == "true";
if(!codingGuidelinesDetectionNode["Message"].isNull())
result_.testSetting.codingGuidelinesDetection.message = codingGuidelinesDetectionNode["Message"].asString();
auto sensitiveInfoDetectionNode = testSettingNode["SensitiveInfoDetection"];
if(!sensitiveInfoDetectionNode["Enabled"].isNull())
result_.testSetting.sensitiveInfoDetection.enabled = sensitiveInfoDetectionNode["Enabled"].asString() == "true";
if(!sensitiveInfoDetectionNode["Message"].isNull())
result_.testSetting.sensitiveInfoDetection.message = sensitiveInfoDetectionNode["Message"].asString();
auto checkConfigNode = testSettingNode["CheckConfig"];
auto allCheckItemsNode = checkConfigNode["CheckItems"]["CheckItemsItem"];
for (auto checkConfigNodeCheckItemsCheckItemsItem : allCheckItemsNode)
{
Result::TestSetting::CheckConfig::CheckItemsItem checkItemsItemObject;
if(!checkConfigNodeCheckItemsCheckItemsItem["Name"].isNull())
checkItemsItemObject.name = checkConfigNodeCheckItemsCheckItemsItem["Name"].asString();
if(!checkConfigNodeCheckItemsCheckItemsItem["Required"].isNull())
checkItemsItemObject.required = checkConfigNodeCheckItemsCheckItemsItem["Required"].asString() == "true";
result_.testSetting.checkConfig.checkItems.push_back(checkItemsItemObject);
}
auto allAllowPushRoles = resultNode["AllowPushRoles"]["AllowPushRoles"];
for (auto value : allAllowPushRoles)
result_.allowPushRoles.push_back(value.asString());
auto allAllowMergeRoles = resultNode["AllowMergeRoles"]["AllowMergeRoles"];
for (auto value : allAllowMergeRoles)
result_.allowMergeRoles.push_back(value.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 CreateRepositoryProtectedBranchResult::getErrorCode()const
{
return errorCode_;
}
std::string CreateRepositoryProtectedBranchResult::getErrorMessage()const
{
return errorMessage_;
}
bool CreateRepositoryProtectedBranchResult::getSuccess()const
{
return success_;
}
CreateRepositoryProtectedBranchResult::Result CreateRepositoryProtectedBranchResult::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/DeleteRepositoryProtectedBranchRequest.h>
using AlibabaCloud::Codeup::Model::DeleteRepositoryProtectedBranchRequest;
DeleteRepositoryProtectedBranchRequest::DeleteRepositoryProtectedBranchRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v4/projects/[ProjectId]/repository/protect_branches/[ProtectedBranchId]");
setMethod(HttpRequest::Method::Delete);
}
DeleteRepositoryProtectedBranchRequest::~DeleteRepositoryProtectedBranchRequest()
{}
std::string DeleteRepositoryProtectedBranchRequest::getOrganizationId()const
{
return organizationId_;
}
void DeleteRepositoryProtectedBranchRequest::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
long DeleteRepositoryProtectedBranchRequest::getProtectedBranchId()const
{
return protectedBranchId_;
}
void DeleteRepositoryProtectedBranchRequest::setProtectedBranchId(long protectedBranchId)
{
protectedBranchId_ = protectedBranchId;
setParameter("ProtectedBranchId", std::to_string(protectedBranchId));
}
std::string DeleteRepositoryProtectedBranchRequest::getAccessToken()const
{
return accessToken_;
}
void DeleteRepositoryProtectedBranchRequest::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}
long DeleteRepositoryProtectedBranchRequest::getProjectId()const
{
return projectId_;
}
void DeleteRepositoryProtectedBranchRequest::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/DeleteRepositoryProtectedBranchResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
DeleteRepositoryProtectedBranchResult::DeleteRepositoryProtectedBranchResult() :
ServiceResult()
{}
DeleteRepositoryProtectedBranchResult::DeleteRepositoryProtectedBranchResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
DeleteRepositoryProtectedBranchResult::~DeleteRepositoryProtectedBranchResult()
{}
void DeleteRepositoryProtectedBranchResult::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["Result"].isNull())
result_.result = resultNode["Result"].asString() == "true";
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 DeleteRepositoryProtectedBranchResult::getErrorCode()const
{
return errorCode_;
}
std::string DeleteRepositoryProtectedBranchResult::getErrorMessage()const
{
return errorMessage_;
}
bool DeleteRepositoryProtectedBranchResult::getSuccess()const
{
return success_;
}
DeleteRepositoryProtectedBranchResult::Result DeleteRepositoryProtectedBranchResult::getResult()const
{
return result_;
}

View File

@@ -0,0 +1,85 @@
/*
* 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/EnableRepositoryDeployKeyRequest.h>
using AlibabaCloud::Codeup::Model::EnableRepositoryDeployKeyRequest;
EnableRepositoryDeployKeyRequest::EnableRepositoryDeployKeyRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v3/projects/[ProjectId]/keys/[KeyId]/enable");
setMethod(HttpRequest::Method::Post);
}
EnableRepositoryDeployKeyRequest::~EnableRepositoryDeployKeyRequest()
{}
std::string EnableRepositoryDeployKeyRequest::getOrganizationId()const
{
return organizationId_;
}
void EnableRepositoryDeployKeyRequest::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string EnableRepositoryDeployKeyRequest::getSubUserId()const
{
return subUserId_;
}
void EnableRepositoryDeployKeyRequest::setSubUserId(const std::string& subUserId)
{
subUserId_ = subUserId;
setParameter("SubUserId", subUserId);
}
std::string EnableRepositoryDeployKeyRequest::getAccessToken()const
{
return accessToken_;
}
void EnableRepositoryDeployKeyRequest::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}
long EnableRepositoryDeployKeyRequest::getKeyId()const
{
return keyId_;
}
void EnableRepositoryDeployKeyRequest::setKeyId(long keyId)
{
keyId_ = keyId;
setParameter("KeyId", std::to_string(keyId));
}
long EnableRepositoryDeployKeyRequest::getProjectId()const
{
return projectId_;
}
void EnableRepositoryDeployKeyRequest::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/EnableRepositoryDeployKeyResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
EnableRepositoryDeployKeyResult::EnableRepositoryDeployKeyResult() :
ServiceResult()
{}
EnableRepositoryDeployKeyResult::EnableRepositoryDeployKeyResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
EnableRepositoryDeployKeyResult::~EnableRepositoryDeployKeyResult()
{}
void EnableRepositoryDeployKeyResult::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["Result"].isNull())
result_.result = resultNode["Result"].asString() == "true";
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 EnableRepositoryDeployKeyResult::getErrorCode()const
{
return errorCode_;
}
std::string EnableRepositoryDeployKeyResult::getErrorMessage()const
{
return errorMessage_;
}
bool EnableRepositoryDeployKeyResult::getSuccess()const
{
return success_;
}
EnableRepositoryDeployKeyResult::Result EnableRepositoryDeployKeyResult::getResult()const
{
return result_;
}

View File

@@ -28,6 +28,17 @@ GetUserInfoRequest::GetUserInfoRequest() :
GetUserInfoRequest::~GetUserInfoRequest()
{}
std::string GetUserInfoRequest::getOrganizationId()const
{
return organizationId_;
}
void GetUserInfoRequest::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string GetUserInfoRequest::getAccessToken()const
{
return accessToken_;

View File

@@ -0,0 +1,206 @@
/*
* 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/ListMergeRequestsRequest.h>
using AlibabaCloud::Codeup::Model::ListMergeRequestsRequest;
ListMergeRequestsRequest::ListMergeRequestsRequest() :
RoaServiceRequest("codeup", "2020-04-14")
{
setResourcePath("/api/v4/merge_requests/advanced_search");
setMethod(HttpRequest::Method::Get);
}
ListMergeRequestsRequest::~ListMergeRequestsRequest()
{}
std::string ListMergeRequestsRequest::getBeforeDate()const
{
return beforeDate_;
}
void ListMergeRequestsRequest::setBeforeDate(const std::string& beforeDate)
{
beforeDate_ = beforeDate;
setParameter("BeforeDate", beforeDate);
}
std::string ListMergeRequestsRequest::getAssigneeIdList()const
{
return assigneeIdList_;
}
void ListMergeRequestsRequest::setAssigneeIdList(const std::string& assigneeIdList)
{
assigneeIdList_ = assigneeIdList;
setParameter("AssigneeIdList", assigneeIdList);
}
std::string ListMergeRequestsRequest::getAccessToken()const
{
return accessToken_;
}
void ListMergeRequestsRequest::setAccessToken(const std::string& accessToken)
{
accessToken_ = accessToken;
setParameter("AccessToken", accessToken);
}
std::string ListMergeRequestsRequest::getSubscriberCodeupIdList()const
{
return subscriberCodeupIdList_;
}
void ListMergeRequestsRequest::setSubscriberCodeupIdList(const std::string& subscriberCodeupIdList)
{
subscriberCodeupIdList_ = subscriberCodeupIdList;
setParameter("SubscriberCodeupIdList", subscriberCodeupIdList);
}
std::string ListMergeRequestsRequest::getAfterDate()const
{
return afterDate_;
}
void ListMergeRequestsRequest::setAfterDate(const std::string& afterDate)
{
afterDate_ = afterDate;
setParameter("AfterDate", afterDate);
}
std::string ListMergeRequestsRequest::getOrganizationId()const
{
return organizationId_;
}
void ListMergeRequestsRequest::setOrganizationId(const std::string& organizationId)
{
organizationId_ = organizationId;
setParameter("OrganizationId", organizationId);
}
std::string ListMergeRequestsRequest::getGroupIdList()const
{
return groupIdList_;
}
void ListMergeRequestsRequest::setGroupIdList(const std::string& groupIdList)
{
groupIdList_ = groupIdList;
setParameter("GroupIdList", groupIdList);
}
std::string ListMergeRequestsRequest::getSearch()const
{
return search_;
}
void ListMergeRequestsRequest::setSearch(const std::string& search)
{
search_ = search;
setParameter("Search", search);
}
std::string ListMergeRequestsRequest::getAuthorCodeupIdList()const
{
return authorCodeupIdList_;
}
void ListMergeRequestsRequest::setAuthorCodeupIdList(const std::string& authorCodeupIdList)
{
authorCodeupIdList_ = authorCodeupIdList;
setParameter("AuthorCodeupIdList", authorCodeupIdList);
}
std::string ListMergeRequestsRequest::getAuthorIdList()const
{
return authorIdList_;
}
void ListMergeRequestsRequest::setAuthorIdList(const std::string& authorIdList)
{
authorIdList_ = authorIdList;
setParameter("AuthorIdList", authorIdList);
}
long ListMergeRequestsRequest::getPageSize()const
{
return pageSize_;
}
void ListMergeRequestsRequest::setPageSize(long pageSize)
{
pageSize_ = pageSize;
setParameter("PageSize", std::to_string(pageSize));
}
std::string ListMergeRequestsRequest::getProjectIdList()const
{
return projectIdList_;
}
void ListMergeRequestsRequest::setProjectIdList(const std::string& projectIdList)
{
projectIdList_ = projectIdList;
setParameter("ProjectIdList", projectIdList);
}
long ListMergeRequestsRequest::getPage()const
{
return page_;
}
void ListMergeRequestsRequest::setPage(long page)
{
page_ = page;
setParameter("Page", std::to_string(page));
}
std::string ListMergeRequestsRequest::getAssigneeCodeupIdList()const
{
return assigneeCodeupIdList_;
}
void ListMergeRequestsRequest::setAssigneeCodeupIdList(const std::string& assigneeCodeupIdList)
{
assigneeCodeupIdList_ = assigneeCodeupIdList;
setParameter("AssigneeCodeupIdList", assigneeCodeupIdList);
}
std::string ListMergeRequestsRequest::getState()const
{
return state_;
}
void ListMergeRequestsRequest::setState(const std::string& state)
{
state_ = state;
setParameter("State", state);
}
std::string ListMergeRequestsRequest::getOrder()const
{
return order_;
}
void ListMergeRequestsRequest::setOrder(const std::string& order)
{
order_ = order;
setParameter("Order", order);
}

View File

@@ -0,0 +1,209 @@
/*
* 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/ListMergeRequestsResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
ListMergeRequestsResult::ListMergeRequestsResult() :
ServiceResult()
{}
ListMergeRequestsResult::ListMergeRequestsResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
ListMergeRequestsResult::~ListMergeRequestsResult()
{}
void ListMergeRequestsResult::parse(const std::string &payload)
{
Json::Reader reader;
Json::Value value;
reader.parse(payload, value);
setRequestId(value["RequestId"].asString());
auto allResultNode = value["Result"]["ResultItem"];
for (auto valueResultResultItem : allResultNode)
{
ResultItem resultObject;
if(!valueResultResultItem["AcceptedRevision"].isNull())
resultObject.acceptedRevision = valueResultResultItem["AcceptedRevision"].asString();
if(!valueResultResultItem["AheadCommitCount"].isNull())
resultObject.aheadCommitCount = std::stoi(valueResultResultItem["AheadCommitCount"].asString());
if(!valueResultResultItem["BehindCommitCount"].isNull())
resultObject.behindCommitCount = std::stoi(valueResultResultItem["BehindCommitCount"].asString());
if(!valueResultResultItem["CreatedAt"].isNull())
resultObject.createdAt = valueResultResultItem["CreatedAt"].asString();
if(!valueResultResultItem["Description"].isNull())
resultObject.description = valueResultResultItem["Description"].asString();
if(!valueResultResultItem["Id"].isNull())
resultObject.id = std::stol(valueResultResultItem["Id"].asString());
if(!valueResultResultItem["MergeError"].isNull())
resultObject.mergeError = valueResultResultItem["MergeError"].asString();
if(!valueResultResultItem["MergeStatus"].isNull())
resultObject.mergeStatus = valueResultResultItem["MergeStatus"].asString();
if(!valueResultResultItem["MergeType"].isNull())
resultObject.mergeType = valueResultResultItem["MergeType"].asString();
if(!valueResultResultItem["MergedRevision"].isNull())
resultObject.mergedRevision = valueResultResultItem["MergedRevision"].asString();
if(!valueResultResultItem["NameWithNamespace"].isNull())
resultObject.nameWithNamespace = valueResultResultItem["NameWithNamespace"].asString();
if(!valueResultResultItem["ProjectId"].isNull())
resultObject.projectId = std::stol(valueResultResultItem["ProjectId"].asString());
if(!valueResultResultItem["SourceBranch"].isNull())
resultObject.sourceBranch = valueResultResultItem["SourceBranch"].asString();
if(!valueResultResultItem["State"].isNull())
resultObject.state = valueResultResultItem["State"].asString();
if(!valueResultResultItem["TargetBranch"].isNull())
resultObject.targetBranch = valueResultResultItem["TargetBranch"].asString();
if(!valueResultResultItem["Title"].isNull())
resultObject.title = valueResultResultItem["Title"].asString();
if(!valueResultResultItem["UpdatedAt"].isNull())
resultObject.updatedAt = valueResultResultItem["UpdatedAt"].asString();
if(!valueResultResultItem["WebUrl"].isNull())
resultObject.webUrl = valueResultResultItem["WebUrl"].asString();
auto allAssigneeListNode = valueResultResultItem["AssigneeList"]["AssigneeListItem"];
for (auto valueResultResultItemAssigneeListAssigneeListItem : allAssigneeListNode)
{
ResultItem::AssigneeListItem assigneeListObject;
if(!valueResultResultItemAssigneeListAssigneeListItem["AvatarUrl"].isNull())
assigneeListObject.avatarUrl = valueResultResultItemAssigneeListAssigneeListItem["AvatarUrl"].asString();
if(!valueResultResultItemAssigneeListAssigneeListItem["ExternUserId"].isNull())
assigneeListObject.externUserId = valueResultResultItemAssigneeListAssigneeListItem["ExternUserId"].asString();
if(!valueResultResultItemAssigneeListAssigneeListItem["Id"].isNull())
assigneeListObject.id = valueResultResultItemAssigneeListAssigneeListItem["Id"].asString();
if(!valueResultResultItemAssigneeListAssigneeListItem["Name"].isNull())
assigneeListObject.name = valueResultResultItemAssigneeListAssigneeListItem["Name"].asString();
resultObject.assigneeList.push_back(assigneeListObject);
}
auto approveCheckResultNode = value["ApproveCheckResult"];
if(!approveCheckResultNode["TotalCheckResult"].isNull())
resultObject.approveCheckResult.totalCheckResult = approveCheckResultNode["TotalCheckResult"].asString();
auto allSatisfiedCheckResultsNode = approveCheckResultNode["SatisfiedCheckResults"]["SatisfiedCheckResultsItem"];
for (auto approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem : allSatisfiedCheckResultsNode)
{
ResultItem::ApproveCheckResult::SatisfiedCheckResultsItem satisfiedCheckResultsItemObject;
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckName"].isNull())
satisfiedCheckResultsItemObject.checkName = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckName"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckStatus"].isNull())
satisfiedCheckResultsItemObject.checkStatus = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckStatus"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckType"].isNull())
satisfiedCheckResultsItemObject.checkType = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["CheckType"].asString();
auto allExtraUsersNode = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItem["ExtraUsers"]["ExtraUsersItem"];
for (auto approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem : allExtraUsersNode)
{
ResultItem::ApproveCheckResult::SatisfiedCheckResultsItem::ExtraUsersItem extraUsersObject;
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsersObject.avatarUrl = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsersObject.externUserId = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].isNull())
extraUsersObject.id = std::stol(approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].asString());
if(!approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].isNull())
extraUsersObject.name = approveCheckResultNodeSatisfiedCheckResultsSatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].asString();
satisfiedCheckResultsItemObject.extraUsers.push_back(extraUsersObject);
}
auto allSatisfiedItems = value["SatisfiedItems"]["SatisfiedItems"];
for (auto value : allSatisfiedItems)
satisfiedCheckResultsItemObject.satisfiedItems.push_back(value.asString());
auto allUnsatisfiedItems = value["UnsatisfiedItems"]["UnsatisfiedItems"];
for (auto value : allUnsatisfiedItems)
satisfiedCheckResultsItemObject.unsatisfiedItems.push_back(value.asString());
resultObject.approveCheckResult.satisfiedCheckResults.push_back(satisfiedCheckResultsItemObject);
}
auto allUnsatisfiedCheckResultsNode = approveCheckResultNode["UnsatisfiedCheckResults"]["UnsatisfiedCheckResultsItem"];
for (auto approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem : allUnsatisfiedCheckResultsNode)
{
ResultItem::ApproveCheckResult::UnsatisfiedCheckResultsItem unsatisfiedCheckResultsItemObject;
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckName"].isNull())
unsatisfiedCheckResultsItemObject.checkName = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckName"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckStatus"].isNull())
unsatisfiedCheckResultsItemObject.checkStatus = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckStatus"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckType"].isNull())
unsatisfiedCheckResultsItemObject.checkType = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["CheckType"].asString();
auto allExtraUsers3Node = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItem["ExtraUsers"]["ExtraUsersItem"];
for (auto approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem : allExtraUsers3Node)
{
ResultItem::ApproveCheckResult::UnsatisfiedCheckResultsItem::ExtraUsersItem4 extraUsers3Object;
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].isNull())
extraUsers3Object.avatarUrl = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["AvatarUrl"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].isNull())
extraUsers3Object.externUserId = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["ExternUserId"].asString();
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].isNull())
extraUsers3Object.id = std::stol(approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Id"].asString());
if(!approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].isNull())
extraUsers3Object.name = approveCheckResultNodeUnsatisfiedCheckResultsUnsatisfiedCheckResultsItemExtraUsersExtraUsersItem["Name"].asString();
unsatisfiedCheckResultsItemObject.extraUsers3.push_back(extraUsers3Object);
}
auto allSatisfiedItems1 = value["SatisfiedItems"]["SatisfiedItems"];
for (auto value : allSatisfiedItems1)
unsatisfiedCheckResultsItemObject.satisfiedItems1.push_back(value.asString());
auto allUnsatisfiedItems2 = value["UnsatisfiedItems"]["UnsatisfiedItems"];
for (auto value : allUnsatisfiedItems2)
unsatisfiedCheckResultsItemObject.unsatisfiedItems2.push_back(value.asString());
resultObject.approveCheckResult.unsatisfiedCheckResults.push_back(unsatisfiedCheckResultsItemObject);
}
auto authorNode = value["Author"];
if(!authorNode["AvatarUrl"].isNull())
resultObject.author.avatarUrl = authorNode["AvatarUrl"].asString();
if(!authorNode["ExternUserId"].isNull())
resultObject.author.externUserId = authorNode["ExternUserId"].asString();
if(!authorNode["Id"].isNull())
resultObject.author.id = std::stol(authorNode["Id"].asString());
if(!authorNode["Name"].isNull())
resultObject.author.name = authorNode["Name"].asString();
result_.push_back(resultObject);
}
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";
if(!value["Total"].isNull())
total_ = std::stol(value["Total"].asString());
}
long ListMergeRequestsResult::getTotal()const
{
return total_;
}
std::string ListMergeRequestsResult::getErrorCode()const
{
return errorCode_;
}
std::string ListMergeRequestsResult::getErrorMessage()const
{
return errorMessage_;
}
bool ListMergeRequestsResult::getSuccess()const
{
return success_;
}
std::vector<ListMergeRequestsResult::ResultItem> ListMergeRequestsResult::getResult()const
{
return result_;
}

View File

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

View File

@@ -0,0 +1,124 @@
/*
* 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/UpdateRepositoryResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Codeup;
using namespace AlibabaCloud::Codeup::Model;
UpdateRepositoryResult::UpdateRepositoryResult() :
ServiceResult()
{}
UpdateRepositoryResult::UpdateRepositoryResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
UpdateRepositoryResult::~UpdateRepositoryResult()
{}
void UpdateRepositoryResult::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["Archive"].isNull())
result_.archive = resultNode["Archive"].asString() == "true";
if(!resultNode["AvatarUrl"].isNull())
result_.avatarUrl = resultNode["AvatarUrl"].asString();
if(!resultNode["CreatedAt"].isNull())
result_.createdAt = resultNode["CreatedAt"].asString();
if(!resultNode["CreatorId"].isNull())
result_.creatorId = std::stol(resultNode["CreatorId"].asString());
if(!resultNode["DefaultBranch"].isNull())
result_.defaultBranch = resultNode["DefaultBranch"].asString();
if(!resultNode["Description"].isNull())
result_.description = resultNode["Description"].asString();
if(!resultNode["HttpUrlToRepo"].isNull())
result_.httpUrlToRepo = resultNode["HttpUrlToRepo"].asString();
if(!resultNode["Id"].isNull())
result_.id = std::stol(resultNode["Id"].asString());
if(!resultNode["LastActivityAt"].isNull())
result_.lastActivityAt = resultNode["LastActivityAt"].asString();
if(!resultNode["Name"].isNull())
result_.name = resultNode["Name"].asString();
if(!resultNode["NameWithNamespace"].isNull())
result_.nameWithNamespace = resultNode["NameWithNamespace"].asString();
if(!resultNode["Path"].isNull())
result_.path = resultNode["Path"].asString();
if(!resultNode["PathWithNamespace"].isNull())
result_.pathWithNamespace = resultNode["PathWithNamespace"].asString();
if(!resultNode["SshUrlToRepo"].isNull())
result_.sshUrlToRepo = resultNode["SshUrlToRepo"].asString();
if(!resultNode["VisibilityLevel"].isNull())
result_.visibilityLevel = resultNode["VisibilityLevel"].asString();
if(!resultNode["WebUrl"].isNull())
result_.webUrl = resultNode["WebUrl"].asString();
auto _namespaceNode = resultNode["Namespace"];
if(!_namespaceNode["Avatar"].isNull())
result_._namespace.avatar = _namespaceNode["Avatar"].asString();
if(!_namespaceNode["CreatedAt"].isNull())
result_._namespace.createdAt = _namespaceNode["CreatedAt"].asString();
if(!_namespaceNode["Description"].isNull())
result_._namespace.description = _namespaceNode["Description"].asString();
if(!_namespaceNode["Id"].isNull())
result_._namespace.id = std::stol(_namespaceNode["Id"].asString());
if(!_namespaceNode["Name"].isNull())
result_._namespace.name = _namespaceNode["Name"].asString();
if(!_namespaceNode["OwnerId"].isNull())
result_._namespace.ownerId = std::stol(_namespaceNode["OwnerId"].asString());
if(!_namespaceNode["Path"].isNull())
result_._namespace.path = _namespaceNode["Path"].asString();
if(!_namespaceNode["Public"].isNull())
result_._namespace._public = _namespaceNode["Public"].asString() == "true";
if(!_namespaceNode["UpdatedAt"].isNull())
result_._namespace.updatedAt = _namespaceNode["UpdatedAt"].asString();
if(!_namespaceNode["VisibilityLevel"].isNull())
result_._namespace.visibilityLevel = _namespaceNode["VisibilityLevel"].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 UpdateRepositoryResult::getErrorCode()const
{
return errorCode_;
}
std::string UpdateRepositoryResult::getErrorMessage()const
{
return errorMessage_;
}
bool UpdateRepositoryResult::getSuccess()const
{
return success_;
}
UpdateRepositoryResult::Result UpdateRepositoryResult::getResult()const
{
return result_;
}