Просмотр исходного кода

Add GetRepositoryCommit and ListRepositoryCommitDiff API.

sdk-team 5 лет назад
Родитель
Сommit
ae995d3475

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2021-05-12 Version: 1.36.729
+- Add GetRepositoryCommit and ListRepositoryCommitDiff API.
+
 2021-05-12 Version: 1.36.728
 - Create Lindorm Open api.
 

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.728
+1.36.729

+ 8 - 0
codeup/CMakeLists.txt

@@ -89,6 +89,8 @@ set(codeup_public_header_model
 	include/alibabacloud/codeup/model/GetOrganizationSecurityCenterStatusResult.h
 	include/alibabacloud/codeup/model/GetProjectMemberRequest.h
 	include/alibabacloud/codeup/model/GetProjectMemberResult.h
+	include/alibabacloud/codeup/model/GetRepositoryCommitRequest.h
+	include/alibabacloud/codeup/model/GetRepositoryCommitResult.h
 	include/alibabacloud/codeup/model/GetRepositoryInfoRequest.h
 	include/alibabacloud/codeup/model/GetRepositoryInfoResult.h
 	include/alibabacloud/codeup/model/GetRepositoryTagRequest.h
@@ -115,6 +117,8 @@ set(codeup_public_header_model
 	include/alibabacloud/codeup/model/ListRepositoriesResult.h
 	include/alibabacloud/codeup/model/ListRepositoryBranchesRequest.h
 	include/alibabacloud/codeup/model/ListRepositoryBranchesResult.h
+	include/alibabacloud/codeup/model/ListRepositoryCommitDiffRequest.h
+	include/alibabacloud/codeup/model/ListRepositoryCommitDiffResult.h
 	include/alibabacloud/codeup/model/ListRepositoryCommitsRequest.h
 	include/alibabacloud/codeup/model/ListRepositoryCommitsResult.h
 	include/alibabacloud/codeup/model/ListRepositoryMemberRequest.h
@@ -214,6 +218,8 @@ set(codeup_src
 	src/model/GetOrganizationSecurityCenterStatusResult.cc
 	src/model/GetProjectMemberRequest.cc
 	src/model/GetProjectMemberResult.cc
+	src/model/GetRepositoryCommitRequest.cc
+	src/model/GetRepositoryCommitResult.cc
 	src/model/GetRepositoryInfoRequest.cc
 	src/model/GetRepositoryInfoResult.cc
 	src/model/GetRepositoryTagRequest.cc
@@ -240,6 +246,8 @@ set(codeup_src
 	src/model/ListRepositoriesResult.cc
 	src/model/ListRepositoryBranchesRequest.cc
 	src/model/ListRepositoryBranchesResult.cc
+	src/model/ListRepositoryCommitDiffRequest.cc
+	src/model/ListRepositoryCommitDiffResult.cc
 	src/model/ListRepositoryCommitsRequest.cc
 	src/model/ListRepositoryCommitsResult.cc
 	src/model/ListRepositoryMemberRequest.cc

+ 16 - 0
codeup/include/alibabacloud/codeup/CodeupClient.h

@@ -90,6 +90,8 @@
 #include "model/GetOrganizationSecurityCenterStatusResult.h"
 #include "model/GetProjectMemberRequest.h"
 #include "model/GetProjectMemberResult.h"
+#include "model/GetRepositoryCommitRequest.h"
+#include "model/GetRepositoryCommitResult.h"
 #include "model/GetRepositoryInfoRequest.h"
 #include "model/GetRepositoryInfoResult.h"
 #include "model/GetRepositoryTagRequest.h"
@@ -116,6 +118,8 @@
 #include "model/ListRepositoriesResult.h"
 #include "model/ListRepositoryBranchesRequest.h"
 #include "model/ListRepositoryBranchesResult.h"
+#include "model/ListRepositoryCommitDiffRequest.h"
+#include "model/ListRepositoryCommitDiffResult.h"
 #include "model/ListRepositoryCommitsRequest.h"
 #include "model/ListRepositoryCommitsResult.h"
 #include "model/ListRepositoryMemberRequest.h"
@@ -255,6 +259,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::GetProjectMemberResult> GetProjectMemberOutcome;
 			typedef std::future<GetProjectMemberOutcome> GetProjectMemberOutcomeCallable;
 			typedef std::function<void(const CodeupClient*, const Model::GetProjectMemberRequest&, const GetProjectMemberOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetProjectMemberAsyncHandler;
+			typedef Outcome<Error, Model::GetRepositoryCommitResult> GetRepositoryCommitOutcome;
+			typedef std::future<GetRepositoryCommitOutcome> GetRepositoryCommitOutcomeCallable;
+			typedef std::function<void(const CodeupClient*, const Model::GetRepositoryCommitRequest&, const GetRepositoryCommitOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetRepositoryCommitAsyncHandler;
 			typedef Outcome<Error, Model::GetRepositoryInfoResult> GetRepositoryInfoOutcome;
 			typedef std::future<GetRepositoryInfoOutcome> GetRepositoryInfoOutcomeCallable;
 			typedef std::function<void(const CodeupClient*, const Model::GetRepositoryInfoRequest&, const GetRepositoryInfoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetRepositoryInfoAsyncHandler;
@@ -294,6 +301,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::ListRepositoryBranchesResult> ListRepositoryBranchesOutcome;
 			typedef std::future<ListRepositoryBranchesOutcome> ListRepositoryBranchesOutcomeCallable;
 			typedef std::function<void(const CodeupClient*, const Model::ListRepositoryBranchesRequest&, const ListRepositoryBranchesOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListRepositoryBranchesAsyncHandler;
+			typedef Outcome<Error, Model::ListRepositoryCommitDiffResult> ListRepositoryCommitDiffOutcome;
+			typedef std::future<ListRepositoryCommitDiffOutcome> ListRepositoryCommitDiffOutcomeCallable;
+			typedef std::function<void(const CodeupClient*, const Model::ListRepositoryCommitDiffRequest&, const ListRepositoryCommitDiffOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListRepositoryCommitDiffAsyncHandler;
 			typedef Outcome<Error, Model::ListRepositoryCommitsResult> ListRepositoryCommitsOutcome;
 			typedef std::future<ListRepositoryCommitsOutcome> ListRepositoryCommitsOutcomeCallable;
 			typedef std::function<void(const CodeupClient*, const Model::ListRepositoryCommitsRequest&, const ListRepositoryCommitsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListRepositoryCommitsAsyncHandler;
@@ -443,6 +453,9 @@ namespace AlibabaCloud
 			GetProjectMemberOutcome getProjectMember(const Model::GetProjectMemberRequest &request)const;
 			void getProjectMemberAsync(const Model::GetProjectMemberRequest& request, const GetProjectMemberAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetProjectMemberOutcomeCallable getProjectMemberCallable(const Model::GetProjectMemberRequest& request) const;
+			GetRepositoryCommitOutcome getRepositoryCommit(const Model::GetRepositoryCommitRequest &request)const;
+			void getRepositoryCommitAsync(const Model::GetRepositoryCommitRequest& request, const GetRepositoryCommitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			GetRepositoryCommitOutcomeCallable getRepositoryCommitCallable(const Model::GetRepositoryCommitRequest& request) const;
 			GetRepositoryInfoOutcome getRepositoryInfo(const Model::GetRepositoryInfoRequest &request)const;
 			void getRepositoryInfoAsync(const Model::GetRepositoryInfoRequest& request, const GetRepositoryInfoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetRepositoryInfoOutcomeCallable getRepositoryInfoCallable(const Model::GetRepositoryInfoRequest& request) const;
@@ -482,6 +495,9 @@ namespace AlibabaCloud
 			ListRepositoryBranchesOutcome listRepositoryBranches(const Model::ListRepositoryBranchesRequest &request)const;
 			void listRepositoryBranchesAsync(const Model::ListRepositoryBranchesRequest& request, const ListRepositoryBranchesAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			ListRepositoryBranchesOutcomeCallable listRepositoryBranchesCallable(const Model::ListRepositoryBranchesRequest& request) const;
+			ListRepositoryCommitDiffOutcome listRepositoryCommitDiff(const Model::ListRepositoryCommitDiffRequest &request)const;
+			void listRepositoryCommitDiffAsync(const Model::ListRepositoryCommitDiffRequest& request, const ListRepositoryCommitDiffAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			ListRepositoryCommitDiffOutcomeCallable listRepositoryCommitDiffCallable(const Model::ListRepositoryCommitDiffRequest& request) const;
 			ListRepositoryCommitsOutcome listRepositoryCommits(const Model::ListRepositoryCommitsRequest &request)const;
 			void listRepositoryCommitsAsync(const Model::ListRepositoryCommitsRequest& request, const ListRepositoryCommitsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			ListRepositoryCommitsOutcomeCallable listRepositoryCommitsCallable(const Model::ListRepositoryCommitsRequest& request) const;

+ 57 - 0
codeup/include/alibabacloud/codeup/model/GetRepositoryCommitRequest.h

@@ -0,0 +1,57 @@
+/*
+ * 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_CODEUP_MODEL_GETREPOSITORYCOMMITREQUEST_H_
+#define ALIBABACLOUD_CODEUP_MODEL_GETREPOSITORYCOMMITREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RoaServiceRequest.h>
+#include <alibabacloud/codeup/CodeupExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Codeup
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_CODEUP_EXPORT GetRepositoryCommitRequest : public RoaServiceRequest
+			{
+
+			public:
+				GetRepositoryCommitRequest();
+				~GetRepositoryCommitRequest();
+
+				std::string getOrganizationId()const;
+				void setOrganizationId(const std::string& organizationId);
+				std::string getAccessToken()const;
+				void setAccessToken(const std::string& accessToken);
+				long getProjectId()const;
+				void setProjectId(long projectId);
+				std::string getSha()const;
+				void setSha(const std::string& sha);
+
+            private:
+				std::string organizationId_;
+				std::string accessToken_;
+				long projectId_;
+				std::string sha_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_CODEUP_MODEL_GETREPOSITORYCOMMITREQUEST_H_

+ 78 - 0
codeup/include/alibabacloud/codeup/model/GetRepositoryCommitResult.h

@@ -0,0 +1,78 @@
+/*
+ * 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_CODEUP_MODEL_GETREPOSITORYCOMMITRESULT_H_
+#define ALIBABACLOUD_CODEUP_MODEL_GETREPOSITORYCOMMITRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/codeup/CodeupExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Codeup
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_CODEUP_EXPORT GetRepositoryCommitResult : public ServiceResult
+			{
+			public:
+				struct Result
+				{
+					struct Signature
+					{
+						std::string verificationStatus;
+						std::string gpgKeyId;
+					};
+					std::string authorName;
+					std::string message;
+					std::string createdAt;
+					std::string title;
+					std::string authorEmail;
+					std::string authorDate;
+					std::string committedDate;
+					std::string committerEmail;
+					std::vector<std::string> parentIds;
+					Signature signature;
+					std::string shortId;
+					std::string id;
+					std::string committerName;
+				};
+
+
+				GetRepositoryCommitResult();
+				explicit GetRepositoryCommitResult(const std::string &payload);
+				~GetRepositoryCommitResult();
+				std::string getErrorCode()const;
+				std::string getErrorMessage()const;
+				bool getSuccess()const;
+				Result getResult()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::string errorCode_;
+				std::string errorMessage_;
+				bool success_;
+				Result result_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_CODEUP_MODEL_GETREPOSITORYCOMMITRESULT_H_

+ 60 - 0
codeup/include/alibabacloud/codeup/model/ListRepositoryCommitDiffRequest.h

@@ -0,0 +1,60 @@
+/*
+ * 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_CODEUP_MODEL_LISTREPOSITORYCOMMITDIFFREQUEST_H_
+#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYCOMMITDIFFREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RoaServiceRequest.h>
+#include <alibabacloud/codeup/CodeupExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Codeup
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_CODEUP_EXPORT ListRepositoryCommitDiffRequest : public RoaServiceRequest
+			{
+
+			public:
+				ListRepositoryCommitDiffRequest();
+				~ListRepositoryCommitDiffRequest();
+
+				std::string getOrganizationId()const;
+				void setOrganizationId(const std::string& organizationId);
+				std::string getAccessToken()const;
+				void setAccessToken(const std::string& accessToken);
+				int getContextLine()const;
+				void setContextLine(int contextLine);
+				long getProjectId()const;
+				void setProjectId(long projectId);
+				std::string getSha()const;
+				void setSha(const std::string& sha);
+
+            private:
+				std::string organizationId_;
+				std::string accessToken_;
+				int contextLine_;
+				long projectId_;
+				std::string sha_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYCOMMITDIFFREQUEST_H_

+ 73 - 0
codeup/include/alibabacloud/codeup/model/ListRepositoryCommitDiffResult.h

@@ -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.
+ */
+
+#ifndef ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYCOMMITDIFFRESULT_H_
+#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYCOMMITDIFFRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/codeup/CodeupExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Codeup
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_CODEUP_EXPORT ListRepositoryCommitDiffResult : public ServiceResult
+			{
+			public:
+				struct ResultItem
+				{
+					bool isNewLfs;
+					std::string newId;
+					std::string bMode;
+					std::string diff;
+					bool deletedFile;
+					std::string oldId;
+					bool isOldLfs;
+					bool newFile;
+					std::string oldPath;
+					bool renamedFile;
+					bool isBinary;
+					std::string newPath;
+					std::string aMode;
+				};
+
+
+				ListRepositoryCommitDiffResult();
+				explicit ListRepositoryCommitDiffResult(const std::string &payload);
+				~ListRepositoryCommitDiffResult();
+				std::string getErrorCode()const;
+				std::string getErrorMessage()const;
+				bool getSuccess()const;
+				std::vector<ResultItem> getResult()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::string errorCode_;
+				std::string errorMessage_;
+				bool success_;
+				std::vector<ResultItem> result_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYCOMMITDIFFRESULT_H_

+ 72 - 0
codeup/src/CodeupClient.cc

@@ -1275,6 +1275,42 @@ CodeupClient::GetProjectMemberOutcomeCallable CodeupClient::getProjectMemberCall
 	return task->get_future();
 }
 
+CodeupClient::GetRepositoryCommitOutcome CodeupClient::getRepositoryCommit(const GetRepositoryCommitRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return GetRepositoryCommitOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return GetRepositoryCommitOutcome(GetRepositoryCommitResult(outcome.result()));
+	else
+		return GetRepositoryCommitOutcome(outcome.error());
+}
+
+void CodeupClient::getRepositoryCommitAsync(const GetRepositoryCommitRequest& request, const GetRepositoryCommitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, getRepositoryCommit(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+CodeupClient::GetRepositoryCommitOutcomeCallable CodeupClient::getRepositoryCommitCallable(const GetRepositoryCommitRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<GetRepositoryCommitOutcome()>>(
+			[this, request]()
+			{
+			return this->getRepositoryCommit(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 CodeupClient::GetRepositoryInfoOutcome CodeupClient::getRepositoryInfo(const GetRepositoryInfoRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();
@@ -1743,6 +1779,42 @@ CodeupClient::ListRepositoryBranchesOutcomeCallable CodeupClient::listRepository
 	return task->get_future();
 }
 
+CodeupClient::ListRepositoryCommitDiffOutcome CodeupClient::listRepositoryCommitDiff(const ListRepositoryCommitDiffRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return ListRepositoryCommitDiffOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return ListRepositoryCommitDiffOutcome(ListRepositoryCommitDiffResult(outcome.result()));
+	else
+		return ListRepositoryCommitDiffOutcome(outcome.error());
+}
+
+void CodeupClient::listRepositoryCommitDiffAsync(const ListRepositoryCommitDiffRequest& request, const ListRepositoryCommitDiffAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, listRepositoryCommitDiff(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+CodeupClient::ListRepositoryCommitDiffOutcomeCallable CodeupClient::listRepositoryCommitDiffCallable(const ListRepositoryCommitDiffRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<ListRepositoryCommitDiffOutcome()>>(
+			[this, request]()
+			{
+			return this->listRepositoryCommitDiff(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 CodeupClient::ListRepositoryCommitsOutcome CodeupClient::listRepositoryCommits(const ListRepositoryCommitsRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 74 - 0
codeup/src/model/GetRepositoryCommitRequest.cc

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

+ 101 - 0
codeup/src/model/GetRepositoryCommitResult.cc

@@ -0,0 +1,101 @@
+/*
+ * 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/GetRepositoryCommitResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Codeup;
+using namespace AlibabaCloud::Codeup::Model;
+
+GetRepositoryCommitResult::GetRepositoryCommitResult() :
+	ServiceResult()
+{}
+
+GetRepositoryCommitResult::GetRepositoryCommitResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+GetRepositoryCommitResult::~GetRepositoryCommitResult()
+{}
+
+void GetRepositoryCommitResult::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["AuthorDate"].isNull())
+		result_.authorDate = resultNode["AuthorDate"].asString();
+	if(!resultNode["AuthorEmail"].isNull())
+		result_.authorEmail = resultNode["AuthorEmail"].asString();
+	if(!resultNode["AuthorName"].isNull())
+		result_.authorName = resultNode["AuthorName"].asString();
+	if(!resultNode["CommittedDate"].isNull())
+		result_.committedDate = resultNode["CommittedDate"].asString();
+	if(!resultNode["CommitterEmail"].isNull())
+		result_.committerEmail = resultNode["CommitterEmail"].asString();
+	if(!resultNode["CommitterName"].isNull())
+		result_.committerName = resultNode["CommitterName"].asString();
+	if(!resultNode["CreatedAt"].isNull())
+		result_.createdAt = resultNode["CreatedAt"].asString();
+	if(!resultNode["Id"].isNull())
+		result_.id = resultNode["Id"].asString();
+	if(!resultNode["Message"].isNull())
+		result_.message = resultNode["Message"].asString();
+	if(!resultNode["ShortId"].isNull())
+		result_.shortId = resultNode["ShortId"].asString();
+	if(!resultNode["Title"].isNull())
+		result_.title = resultNode["Title"].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();
+		auto allParentIds = resultNode["ParentIds"]["ParentIds"];
+		for (auto value : allParentIds)
+			result_.parentIds.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 GetRepositoryCommitResult::getErrorCode()const
+{
+	return errorCode_;
+}
+
+std::string GetRepositoryCommitResult::getErrorMessage()const
+{
+	return errorMessage_;
+}
+
+bool GetRepositoryCommitResult::getSuccess()const
+{
+	return success_;
+}
+
+GetRepositoryCommitResult::Result GetRepositoryCommitResult::getResult()const
+{
+	return result_;
+}
+

+ 85 - 0
codeup/src/model/ListRepositoryCommitDiffRequest.cc

@@ -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/ListRepositoryCommitDiffRequest.h>
+
+using AlibabaCloud::Codeup::Model::ListRepositoryCommitDiffRequest;
+
+ListRepositoryCommitDiffRequest::ListRepositoryCommitDiffRequest() :
+	RoaServiceRequest("codeup", "2020-04-14")
+{
+	setResourcePath("/api/v3/projects/[ProjectId]/repository/commits/[Sha]/diff");
+	setMethod(HttpRequest::Method::Get);
+}
+
+ListRepositoryCommitDiffRequest::~ListRepositoryCommitDiffRequest()
+{}
+
+std::string ListRepositoryCommitDiffRequest::getOrganizationId()const
+{
+	return organizationId_;
+}
+
+void ListRepositoryCommitDiffRequest::setOrganizationId(const std::string& organizationId)
+{
+	organizationId_ = organizationId;
+	setParameter("OrganizationId", organizationId);
+}
+
+std::string ListRepositoryCommitDiffRequest::getAccessToken()const
+{
+	return accessToken_;
+}
+
+void ListRepositoryCommitDiffRequest::setAccessToken(const std::string& accessToken)
+{
+	accessToken_ = accessToken;
+	setParameter("AccessToken", accessToken);
+}
+
+int ListRepositoryCommitDiffRequest::getContextLine()const
+{
+	return contextLine_;
+}
+
+void ListRepositoryCommitDiffRequest::setContextLine(int contextLine)
+{
+	contextLine_ = contextLine;
+	setParameter("ContextLine", std::to_string(contextLine));
+}
+
+long ListRepositoryCommitDiffRequest::getProjectId()const
+{
+	return projectId_;
+}
+
+void ListRepositoryCommitDiffRequest::setProjectId(long projectId)
+{
+	projectId_ = projectId;
+	setParameter("ProjectId", std::to_string(projectId));
+}
+
+std::string ListRepositoryCommitDiffRequest::getSha()const
+{
+	return sha_;
+}
+
+void ListRepositoryCommitDiffRequest::setSha(const std::string& sha)
+{
+	sha_ = sha;
+	setParameter("Sha", sha);
+}
+

+ 102 - 0
codeup/src/model/ListRepositoryCommitDiffResult.cc

@@ -0,0 +1,102 @@
+/*
+ * 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/ListRepositoryCommitDiffResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Codeup;
+using namespace AlibabaCloud::Codeup::Model;
+
+ListRepositoryCommitDiffResult::ListRepositoryCommitDiffResult() :
+	ServiceResult()
+{}
+
+ListRepositoryCommitDiffResult::ListRepositoryCommitDiffResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+ListRepositoryCommitDiffResult::~ListRepositoryCommitDiffResult()
+{}
+
+void ListRepositoryCommitDiffResult::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["AMode"].isNull())
+			resultObject.aMode = valueResultResultItem["AMode"].asString();
+		if(!valueResultResultItem["BMode"].isNull())
+			resultObject.bMode = valueResultResultItem["BMode"].asString();
+		if(!valueResultResultItem["DeletedFile"].isNull())
+			resultObject.deletedFile = valueResultResultItem["DeletedFile"].asString() == "true";
+		if(!valueResultResultItem["Diff"].isNull())
+			resultObject.diff = valueResultResultItem["Diff"].asString();
+		if(!valueResultResultItem["IsBinary"].isNull())
+			resultObject.isBinary = valueResultResultItem["IsBinary"].asString() == "true";
+		if(!valueResultResultItem["IsNewLfs"].isNull())
+			resultObject.isNewLfs = valueResultResultItem["IsNewLfs"].asString() == "true";
+		if(!valueResultResultItem["IsOldLfs"].isNull())
+			resultObject.isOldLfs = valueResultResultItem["IsOldLfs"].asString() == "true";
+		if(!valueResultResultItem["NewFile"].isNull())
+			resultObject.newFile = valueResultResultItem["NewFile"].asString() == "true";
+		if(!valueResultResultItem["NewId"].isNull())
+			resultObject.newId = valueResultResultItem["NewId"].asString();
+		if(!valueResultResultItem["NewPath"].isNull())
+			resultObject.newPath = valueResultResultItem["NewPath"].asString();
+		if(!valueResultResultItem["OldId"].isNull())
+			resultObject.oldId = valueResultResultItem["OldId"].asString();
+		if(!valueResultResultItem["OldPath"].isNull())
+			resultObject.oldPath = valueResultResultItem["OldPath"].asString();
+		if(!valueResultResultItem["RenamedFile"].isNull())
+			resultObject.renamedFile = valueResultResultItem["RenamedFile"].asString() == "true";
+		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";
+
+}
+
+std::string ListRepositoryCommitDiffResult::getErrorCode()const
+{
+	return errorCode_;
+}
+
+std::string ListRepositoryCommitDiffResult::getErrorMessage()const
+{
+	return errorMessage_;
+}
+
+bool ListRepositoryCommitDiffResult::getSuccess()const
+{
+	return success_;
+}
+
+std::vector<ListRepositoryCommitDiffResult::ResultItem> ListRepositoryCommitDiffResult::getResult()const
+{
+	return result_;
+}
+