From cf63bd74d6ee5d07a81e262804a3a11a72a5b92b Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 18 Dec 2020 11:05:12 +0000 Subject: [PATCH] Support ListRepositories, ListOrganizations, GetUserInfo, ListRepositoryWebhook, DeleteRepositoryWebhook api. --- CHANGELOG | 4 + codeup/CMakeLists.txt | 20 ++ .../alibabacloud/codeup/CodeupClient.h | 40 ++++ .../codeup/model/AddWebhookResult.h | 1 + .../model/DeleteRepositoryWebhookRequest.h | 57 ++++++ .../model/DeleteRepositoryWebhookResult.h | 72 +++++++ .../codeup/model/GetUserInfoRequest.h | 48 +++++ .../codeup/model/GetUserInfoResult.h | 66 +++++++ .../codeup/model/ListOrganizationsRequest.h | 54 ++++++ .../codeup/model/ListOrganizationsResult.h | 64 +++++++ .../codeup/model/ListRepositoriesRequest.h | 69 +++++++ .../codeup/model/ListRepositoriesResult.h | 81 ++++++++ .../model/ListRepositoryWebhookRequest.h | 60 ++++++ .../model/ListRepositoryWebhookResult.h | 74 +++++++ codeup/src/CodeupClient.cc | 180 ++++++++++++++++++ codeup/src/model/AddWebhookResult.cc | 2 + .../model/DeleteRepositoryWebhookRequest.cc | 74 +++++++ .../model/DeleteRepositoryWebhookResult.cc | 95 +++++++++ codeup/src/model/GetUserInfoRequest.cc | 41 ++++ codeup/src/model/GetUserInfoResult.cc | 83 ++++++++ codeup/src/model/ListOrganizationsRequest.cc | 63 ++++++ codeup/src/model/ListOrganizationsResult.cc | 84 ++++++++ codeup/src/model/ListRepositoriesRequest.cc | 118 ++++++++++++ codeup/src/model/ListRepositoriesResult.cc | 121 ++++++++++++ .../src/model/ListRepositoryWebhookRequest.cc | 85 +++++++++ .../src/model/ListRepositoryWebhookResult.cc | 107 +++++++++++ 26 files changed, 1763 insertions(+) create mode 100644 codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookRequest.h create mode 100644 codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookResult.h create mode 100644 codeup/include/alibabacloud/codeup/model/GetUserInfoRequest.h create mode 100644 codeup/include/alibabacloud/codeup/model/GetUserInfoResult.h create mode 100644 codeup/include/alibabacloud/codeup/model/ListOrganizationsRequest.h create mode 100644 codeup/include/alibabacloud/codeup/model/ListOrganizationsResult.h create mode 100644 codeup/include/alibabacloud/codeup/model/ListRepositoriesRequest.h create mode 100644 codeup/include/alibabacloud/codeup/model/ListRepositoriesResult.h create mode 100644 codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookRequest.h create mode 100644 codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookResult.h create mode 100644 codeup/src/model/DeleteRepositoryWebhookRequest.cc create mode 100644 codeup/src/model/DeleteRepositoryWebhookResult.cc create mode 100644 codeup/src/model/GetUserInfoRequest.cc create mode 100644 codeup/src/model/GetUserInfoResult.cc create mode 100644 codeup/src/model/ListOrganizationsRequest.cc create mode 100644 codeup/src/model/ListOrganizationsResult.cc create mode 100644 codeup/src/model/ListRepositoriesRequest.cc create mode 100644 codeup/src/model/ListRepositoriesResult.cc create mode 100644 codeup/src/model/ListRepositoryWebhookRequest.cc create mode 100644 codeup/src/model/ListRepositoryWebhookResult.cc diff --git a/CHANGELOG b/CHANGELOG index 5a9b95e59..499275344 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +2020-12-18 Version: patch +- Support ListRepositories, ListOrganizations, GetUserInfo, ListRepositoryWebhook, DeleteRepositoryWebhook api. +- AddWebhook api support SecretToken. + 2020-12-18 Version: patch - Add GetAgentDownloadUrl api. diff --git a/codeup/CMakeLists.txt b/codeup/CMakeLists.txt index 1b7a89529..2fbaecf4c 100644 --- a/codeup/CMakeLists.txt +++ b/codeup/CMakeLists.txt @@ -53,6 +53,8 @@ set(codeup_public_header_model include/alibabacloud/codeup/model/DeleteRepositoryMemberResult.h include/alibabacloud/codeup/model/DeleteRepositoryTagRequest.h include/alibabacloud/codeup/model/DeleteRepositoryTagResult.h + include/alibabacloud/codeup/model/DeleteRepositoryWebhookRequest.h + include/alibabacloud/codeup/model/DeleteRepositoryWebhookResult.h include/alibabacloud/codeup/model/GetBranchInfoRequest.h include/alibabacloud/codeup/model/GetBranchInfoResult.h include/alibabacloud/codeup/model/GetCodeupOrganizationRequest.h @@ -67,12 +69,18 @@ set(codeup_public_header_model include/alibabacloud/codeup/model/GetRepositoryInfoResult.h include/alibabacloud/codeup/model/GetRepositoryTagRequest.h include/alibabacloud/codeup/model/GetRepositoryTagResult.h + include/alibabacloud/codeup/model/GetUserInfoRequest.h + include/alibabacloud/codeup/model/GetUserInfoResult.h include/alibabacloud/codeup/model/ListGroupMemberRequest.h include/alibabacloud/codeup/model/ListGroupMemberResult.h include/alibabacloud/codeup/model/ListGroupRepositoriesRequest.h include/alibabacloud/codeup/model/ListGroupRepositoriesResult.h include/alibabacloud/codeup/model/ListGroupsRequest.h include/alibabacloud/codeup/model/ListGroupsResult.h + include/alibabacloud/codeup/model/ListOrganizationsRequest.h + include/alibabacloud/codeup/model/ListOrganizationsResult.h + include/alibabacloud/codeup/model/ListRepositoriesRequest.h + include/alibabacloud/codeup/model/ListRepositoriesResult.h include/alibabacloud/codeup/model/ListRepositoryBranchesRequest.h include/alibabacloud/codeup/model/ListRepositoryBranchesResult.h include/alibabacloud/codeup/model/ListRepositoryMemberRequest.h @@ -81,6 +89,8 @@ set(codeup_public_header_model include/alibabacloud/codeup/model/ListRepositoryTagsResult.h include/alibabacloud/codeup/model/ListRepositoryTreeRequest.h include/alibabacloud/codeup/model/ListRepositoryTreeResult.h + include/alibabacloud/codeup/model/ListRepositoryWebhookRequest.h + include/alibabacloud/codeup/model/ListRepositoryWebhookResult.h include/alibabacloud/codeup/model/MergeMergeRequestRequest.h include/alibabacloud/codeup/model/MergeMergeRequestResult.h include/alibabacloud/codeup/model/UpdateFileRequest.h @@ -124,6 +134,8 @@ set(codeup_src src/model/DeleteRepositoryMemberResult.cc src/model/DeleteRepositoryTagRequest.cc src/model/DeleteRepositoryTagResult.cc + src/model/DeleteRepositoryWebhookRequest.cc + src/model/DeleteRepositoryWebhookResult.cc src/model/GetBranchInfoRequest.cc src/model/GetBranchInfoResult.cc src/model/GetCodeupOrganizationRequest.cc @@ -138,12 +150,18 @@ set(codeup_src src/model/GetRepositoryInfoResult.cc src/model/GetRepositoryTagRequest.cc src/model/GetRepositoryTagResult.cc + src/model/GetUserInfoRequest.cc + src/model/GetUserInfoResult.cc src/model/ListGroupMemberRequest.cc src/model/ListGroupMemberResult.cc src/model/ListGroupRepositoriesRequest.cc src/model/ListGroupRepositoriesResult.cc src/model/ListGroupsRequest.cc src/model/ListGroupsResult.cc + src/model/ListOrganizationsRequest.cc + src/model/ListOrganizationsResult.cc + src/model/ListRepositoriesRequest.cc + src/model/ListRepositoriesResult.cc src/model/ListRepositoryBranchesRequest.cc src/model/ListRepositoryBranchesResult.cc src/model/ListRepositoryMemberRequest.cc @@ -152,6 +170,8 @@ set(codeup_src src/model/ListRepositoryTagsResult.cc src/model/ListRepositoryTreeRequest.cc src/model/ListRepositoryTreeResult.cc + src/model/ListRepositoryWebhookRequest.cc + src/model/ListRepositoryWebhookResult.cc src/model/MergeMergeRequestRequest.cc src/model/MergeMergeRequestResult.cc src/model/UpdateFileRequest.cc diff --git a/codeup/include/alibabacloud/codeup/CodeupClient.h b/codeup/include/alibabacloud/codeup/CodeupClient.h index 600e14470..4adee8680 100644 --- a/codeup/include/alibabacloud/codeup/CodeupClient.h +++ b/codeup/include/alibabacloud/codeup/CodeupClient.h @@ -54,6 +54,8 @@ #include "model/DeleteRepositoryMemberResult.h" #include "model/DeleteRepositoryTagRequest.h" #include "model/DeleteRepositoryTagResult.h" +#include "model/DeleteRepositoryWebhookRequest.h" +#include "model/DeleteRepositoryWebhookResult.h" #include "model/GetBranchInfoRequest.h" #include "model/GetBranchInfoResult.h" #include "model/GetCodeupOrganizationRequest.h" @@ -68,12 +70,18 @@ #include "model/GetRepositoryInfoResult.h" #include "model/GetRepositoryTagRequest.h" #include "model/GetRepositoryTagResult.h" +#include "model/GetUserInfoRequest.h" +#include "model/GetUserInfoResult.h" #include "model/ListGroupMemberRequest.h" #include "model/ListGroupMemberResult.h" #include "model/ListGroupRepositoriesRequest.h" #include "model/ListGroupRepositoriesResult.h" #include "model/ListGroupsRequest.h" #include "model/ListGroupsResult.h" +#include "model/ListOrganizationsRequest.h" +#include "model/ListOrganizationsResult.h" +#include "model/ListRepositoriesRequest.h" +#include "model/ListRepositoriesResult.h" #include "model/ListRepositoryBranchesRequest.h" #include "model/ListRepositoryBranchesResult.h" #include "model/ListRepositoryMemberRequest.h" @@ -82,6 +90,8 @@ #include "model/ListRepositoryTagsResult.h" #include "model/ListRepositoryTreeRequest.h" #include "model/ListRepositoryTreeResult.h" +#include "model/ListRepositoryWebhookRequest.h" +#include "model/ListRepositoryWebhookResult.h" #include "model/MergeMergeRequestRequest.h" #include "model/MergeMergeRequestResult.h" #include "model/UpdateFileRequest.h" @@ -147,6 +157,9 @@ namespace AlibabaCloud typedef Outcome DeleteRepositoryTagOutcome; typedef std::future DeleteRepositoryTagOutcomeCallable; typedef std::function&)> DeleteRepositoryTagAsyncHandler; + typedef Outcome DeleteRepositoryWebhookOutcome; + typedef std::future DeleteRepositoryWebhookOutcomeCallable; + typedef std::function&)> DeleteRepositoryWebhookAsyncHandler; typedef Outcome GetBranchInfoOutcome; typedef std::future GetBranchInfoOutcomeCallable; typedef std::function&)> GetBranchInfoAsyncHandler; @@ -168,6 +181,9 @@ namespace AlibabaCloud typedef Outcome GetRepositoryTagOutcome; typedef std::future GetRepositoryTagOutcomeCallable; typedef std::function&)> GetRepositoryTagAsyncHandler; + typedef Outcome GetUserInfoOutcome; + typedef std::future GetUserInfoOutcomeCallable; + typedef std::function&)> GetUserInfoAsyncHandler; typedef Outcome ListGroupMemberOutcome; typedef std::future ListGroupMemberOutcomeCallable; typedef std::function&)> ListGroupMemberAsyncHandler; @@ -177,6 +193,12 @@ namespace AlibabaCloud typedef Outcome ListGroupsOutcome; typedef std::future ListGroupsOutcomeCallable; typedef std::function&)> ListGroupsAsyncHandler; + typedef Outcome ListOrganizationsOutcome; + typedef std::future ListOrganizationsOutcomeCallable; + typedef std::function&)> ListOrganizationsAsyncHandler; + typedef Outcome ListRepositoriesOutcome; + typedef std::future ListRepositoriesOutcomeCallable; + typedef std::function&)> ListRepositoriesAsyncHandler; typedef Outcome ListRepositoryBranchesOutcome; typedef std::future ListRepositoryBranchesOutcomeCallable; typedef std::function&)> ListRepositoryBranchesAsyncHandler; @@ -189,6 +211,9 @@ namespace AlibabaCloud typedef Outcome ListRepositoryTreeOutcome; typedef std::future ListRepositoryTreeOutcomeCallable; typedef std::function&)> ListRepositoryTreeAsyncHandler; + typedef Outcome ListRepositoryWebhookOutcome; + typedef std::future ListRepositoryWebhookOutcomeCallable; + typedef std::function&)> ListRepositoryWebhookAsyncHandler; typedef Outcome MergeMergeRequestOutcome; typedef std::future MergeMergeRequestOutcomeCallable; typedef std::function&)> MergeMergeRequestAsyncHandler; @@ -254,6 +279,9 @@ namespace AlibabaCloud DeleteRepositoryTagOutcome deleteRepositoryTag(const Model::DeleteRepositoryTagRequest &request)const; void deleteRepositoryTagAsync(const Model::DeleteRepositoryTagRequest& request, const DeleteRepositoryTagAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; DeleteRepositoryTagOutcomeCallable deleteRepositoryTagCallable(const Model::DeleteRepositoryTagRequest& request) const; + DeleteRepositoryWebhookOutcome deleteRepositoryWebhook(const Model::DeleteRepositoryWebhookRequest &request)const; + void deleteRepositoryWebhookAsync(const Model::DeleteRepositoryWebhookRequest& request, const DeleteRepositoryWebhookAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + DeleteRepositoryWebhookOutcomeCallable deleteRepositoryWebhookCallable(const Model::DeleteRepositoryWebhookRequest& request) const; GetBranchInfoOutcome getBranchInfo(const Model::GetBranchInfoRequest &request)const; void getBranchInfoAsync(const Model::GetBranchInfoRequest& request, const GetBranchInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetBranchInfoOutcomeCallable getBranchInfoCallable(const Model::GetBranchInfoRequest& request) const; @@ -275,6 +303,9 @@ namespace AlibabaCloud GetRepositoryTagOutcome getRepositoryTag(const Model::GetRepositoryTagRequest &request)const; void getRepositoryTagAsync(const Model::GetRepositoryTagRequest& request, const GetRepositoryTagAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetRepositoryTagOutcomeCallable getRepositoryTagCallable(const Model::GetRepositoryTagRequest& request) const; + GetUserInfoOutcome getUserInfo(const Model::GetUserInfoRequest &request)const; + void getUserInfoAsync(const Model::GetUserInfoRequest& request, const GetUserInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetUserInfoOutcomeCallable getUserInfoCallable(const Model::GetUserInfoRequest& request) const; ListGroupMemberOutcome listGroupMember(const Model::ListGroupMemberRequest &request)const; void listGroupMemberAsync(const Model::ListGroupMemberRequest& request, const ListGroupMemberAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListGroupMemberOutcomeCallable listGroupMemberCallable(const Model::ListGroupMemberRequest& request) const; @@ -284,6 +315,12 @@ namespace AlibabaCloud ListGroupsOutcome listGroups(const Model::ListGroupsRequest &request)const; void listGroupsAsync(const Model::ListGroupsRequest& request, const ListGroupsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListGroupsOutcomeCallable listGroupsCallable(const Model::ListGroupsRequest& request) const; + ListOrganizationsOutcome listOrganizations(const Model::ListOrganizationsRequest &request)const; + void listOrganizationsAsync(const Model::ListOrganizationsRequest& request, const ListOrganizationsAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListOrganizationsOutcomeCallable listOrganizationsCallable(const Model::ListOrganizationsRequest& request) const; + ListRepositoriesOutcome listRepositories(const Model::ListRepositoriesRequest &request)const; + void listRepositoriesAsync(const Model::ListRepositoriesRequest& request, const ListRepositoriesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListRepositoriesOutcomeCallable listRepositoriesCallable(const Model::ListRepositoriesRequest& request) const; ListRepositoryBranchesOutcome listRepositoryBranches(const Model::ListRepositoryBranchesRequest &request)const; void listRepositoryBranchesAsync(const Model::ListRepositoryBranchesRequest& request, const ListRepositoryBranchesAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListRepositoryBranchesOutcomeCallable listRepositoryBranchesCallable(const Model::ListRepositoryBranchesRequest& request) const; @@ -296,6 +333,9 @@ namespace AlibabaCloud ListRepositoryTreeOutcome listRepositoryTree(const Model::ListRepositoryTreeRequest &request)const; void listRepositoryTreeAsync(const Model::ListRepositoryTreeRequest& request, const ListRepositoryTreeAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; ListRepositoryTreeOutcomeCallable listRepositoryTreeCallable(const Model::ListRepositoryTreeRequest& request) const; + ListRepositoryWebhookOutcome listRepositoryWebhook(const Model::ListRepositoryWebhookRequest &request)const; + void listRepositoryWebhookAsync(const Model::ListRepositoryWebhookRequest& request, const ListRepositoryWebhookAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + ListRepositoryWebhookOutcomeCallable listRepositoryWebhookCallable(const Model::ListRepositoryWebhookRequest& request) const; MergeMergeRequestOutcome mergeMergeRequest(const Model::MergeMergeRequestRequest &request)const; void mergeMergeRequestAsync(const Model::MergeMergeRequestRequest& request, const MergeMergeRequestAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; MergeMergeRequestOutcomeCallable mergeMergeRequestCallable(const Model::MergeMergeRequestRequest& request) const; diff --git a/codeup/include/alibabacloud/codeup/model/AddWebhookResult.h b/codeup/include/alibabacloud/codeup/model/AddWebhookResult.h index 937315e63..e16d52fcc 100644 --- a/codeup/include/alibabacloud/codeup/model/AddWebhookResult.h +++ b/codeup/include/alibabacloud/codeup/model/AddWebhookResult.h @@ -47,6 +47,7 @@ namespace AlibabaCloud long id; bool enableSslVerification; bool noteEvents; + std::string secretToken; }; diff --git a/codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookRequest.h b/codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookRequest.h new file mode 100644 index 000000000..db82aadac --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookRequest.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_DELETEREPOSITORYWEBHOOKREQUEST_H_ +#define ALIBABACLOUD_CODEUP_MODEL_DELETEREPOSITORYWEBHOOKREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT DeleteRepositoryWebhookRequest : public RoaServiceRequest + { + + public: + DeleteRepositoryWebhookRequest(); + ~DeleteRepositoryWebhookRequest(); + + std::string getOrganizationId()const; + void setOrganizationId(const std::string& organizationId); + long getWebhookId()const; + void setWebhookId(long webhookId); + std::string getAccessToken()const; + void setAccessToken(const std::string& accessToken); + long getProjectId()const; + void setProjectId(long projectId); + + private: + std::string organizationId_; + long webhookId_; + std::string accessToken_; + long projectId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_DELETEREPOSITORYWEBHOOKREQUEST_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookResult.h b/codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookResult.h new file mode 100644 index 000000000..412be20b8 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/DeleteRepositoryWebhookResult.h @@ -0,0 +1,72 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CODEUP_MODEL_DELETEREPOSITORYWEBHOOKRESULT_H_ +#define ALIBABACLOUD_CODEUP_MODEL_DELETEREPOSITORYWEBHOOKRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT DeleteRepositoryWebhookResult : public ServiceResult + { + public: + struct Result + { + std::string description; + std::string lastTestResult; + bool pushEvents; + std::string createdAt; + long projectId; + bool tagPushEvents; + long id; + bool enableSslVerification; + bool noteEvents; + bool mergeRequestsEvents; + std::string url; + std::string secretToken; + }; + + + DeleteRepositoryWebhookResult(); + explicit DeleteRepositoryWebhookResult(const std::string &payload); + ~DeleteRepositoryWebhookResult(); + 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_DELETEREPOSITORYWEBHOOKRESULT_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/GetUserInfoRequest.h b/codeup/include/alibabacloud/codeup/model/GetUserInfoRequest.h new file mode 100644 index 000000000..5db3f5a46 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/GetUserInfoRequest.h @@ -0,0 +1,48 @@ +/* + * 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_GETUSERINFOREQUEST_H_ +#define ALIBABACLOUD_CODEUP_MODEL_GETUSERINFOREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT GetUserInfoRequest : public RoaServiceRequest + { + + public: + GetUserInfoRequest(); + ~GetUserInfoRequest(); + + std::string getAccessToken()const; + void setAccessToken(const std::string& accessToken); + + private: + std::string accessToken_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_GETUSERINFOREQUEST_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/GetUserInfoResult.h b/codeup/include/alibabacloud/codeup/model/GetUserInfoResult.h new file mode 100644 index 000000000..b98f718a9 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/GetUserInfoResult.h @@ -0,0 +1,66 @@ +/* + * 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_GETUSERINFORESULT_H_ +#define ALIBABACLOUD_CODEUP_MODEL_GETUSERINFORESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT GetUserInfoResult : public ServiceResult + { + public: + struct Result + { + std::string email; + std::string avatarUrl; + std::string username; + std::string externalUserId; + long id; + std::string name; + }; + + + GetUserInfoResult(); + explicit GetUserInfoResult(const std::string &payload); + ~GetUserInfoResult(); + 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_GETUSERINFORESULT_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/ListOrganizationsRequest.h b/codeup/include/alibabacloud/codeup/model/ListOrganizationsRequest.h new file mode 100644 index 000000000..ffbbcd5b3 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/ListOrganizationsRequest.h @@ -0,0 +1,54 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_CODEUP_MODEL_LISTORGANIZATIONSREQUEST_H_ +#define ALIBABACLOUD_CODEUP_MODEL_LISTORGANIZATIONSREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT ListOrganizationsRequest : public RoaServiceRequest + { + + public: + ListOrganizationsRequest(); + ~ListOrganizationsRequest(); + + int getAccessLevel()const; + void setAccessLevel(int accessLevel); + int getMinAccessLevel()const; + void setMinAccessLevel(int minAccessLevel); + std::string getAccessToken()const; + void setAccessToken(const std::string& accessToken); + + private: + int accessLevel_; + int minAccessLevel_; + std::string accessToken_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTORGANIZATIONSREQUEST_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/ListOrganizationsResult.h b/codeup/include/alibabacloud/codeup/model/ListOrganizationsResult.h new file mode 100644 index 000000000..647d4c7b3 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/ListOrganizationsResult.h @@ -0,0 +1,64 @@ +/* + * 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_LISTORGANIZATIONSRESULT_H_ +#define ALIBABACLOUD_CODEUP_MODEL_LISTORGANIZATIONSRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT ListOrganizationsResult : public ServiceResult + { + public: + struct ResultItem + { + std::string organizationName; + std::string organizationRole; + std::string organizationId; + int accessLevel; + }; + + + ListOrganizationsResult(); + explicit ListOrganizationsResult(const std::string &payload); + ~ListOrganizationsResult(); + std::string getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + std::vector getResult()const; + + protected: + void parse(const std::string &payload); + private: + std::string errorCode_; + std::string errorMessage_; + bool success_; + std::vector result_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTORGANIZATIONSRESULT_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/ListRepositoriesRequest.h b/codeup/include/alibabacloud/codeup/model/ListRepositoriesRequest.h new file mode 100644 index 000000000..9023e9ad9 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/ListRepositoriesRequest.h @@ -0,0 +1,69 @@ +/* + * 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_LISTREPOSITORIESREQUEST_H_ +#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORIESREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT ListRepositoriesRequest : public RoaServiceRequest + { + + public: + ListRepositoriesRequest(); + ~ListRepositoriesRequest(); + + std::string getAccessToken()const; + void setAccessToken(const std::string& accessToken); + bool getArchive()const; + void setArchive(bool archive); + std::string getSort()const; + void setSort(const std::string& sort); + std::string getOrganizationId()const; + void setOrganizationId(const std::string& organizationId); + std::string getSearch()const; + void setSearch(const std::string& search); + long getPageSize()const; + void setPageSize(long pageSize); + long getPage()const; + void setPage(long page); + std::string getOrder()const; + void setOrder(const std::string& order); + + private: + std::string accessToken_; + bool archive_; + std::string sort_; + std::string organizationId_; + std::string search_; + long pageSize_; + long page_; + std::string order_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORIESREQUEST_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/ListRepositoriesResult.h b/codeup/include/alibabacloud/codeup/model/ListRepositoriesResult.h new file mode 100644 index 000000000..a99378724 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/ListRepositoriesResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORIESRESULT_H_ +#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORIESRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT ListRepositoriesResult : public ServiceResult + { + public: + struct ResultItem + { + std::string path; + std::string pathWithNamespace; + std::string lastActivityAt; + std::string description; + bool archive; + std::string createdAt; + std::string webUrl; + std::string nameWithNamespace; + std::string visibilityLevel; + std::string updatedAt; + int accessLevel; + std::string name; + std::string avatarUrl; + bool demoProjectStatus; + bool star; + std::string importStatus; + long id; + long namespaceId; + long starCount; + }; + + + ListRepositoriesResult(); + explicit ListRepositoriesResult(const std::string &payload); + ~ListRepositoriesResult(); + long getTotal()const; + int getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + std::vector getResult()const; + + protected: + void parse(const std::string &payload); + private: + long total_; + int errorCode_; + std::string errorMessage_; + bool success_; + std::vector result_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORIESRESULT_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookRequest.h b/codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookRequest.h new file mode 100644 index 000000000..027454b6f --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookRequest.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_LISTREPOSITORYWEBHOOKREQUEST_H_ +#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYWEBHOOKREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT ListRepositoryWebhookRequest : public RoaServiceRequest + { + + public: + ListRepositoryWebhookRequest(); + ~ListRepositoryWebhookRequest(); + + std::string getOrganizationId()const; + void setOrganizationId(const std::string& organizationId); + long getPageSize()const; + void setPageSize(long pageSize); + std::string getAccessToken()const; + void setAccessToken(const std::string& accessToken); + long getPage()const; + void setPage(long page); + long getProjectId()const; + void setProjectId(long projectId); + + private: + std::string organizationId_; + long pageSize_; + std::string accessToken_; + long page_; + long projectId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYWEBHOOKREQUEST_H_ \ No newline at end of file diff --git a/codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookResult.h b/codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookResult.h new file mode 100644 index 000000000..a263995f2 --- /dev/null +++ b/codeup/include/alibabacloud/codeup/model/ListRepositoryWebhookResult.h @@ -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. + */ + +#ifndef ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYWEBHOOKRESULT_H_ +#define ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYWEBHOOKRESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Codeup + { + namespace Model + { + class ALIBABACLOUD_CODEUP_EXPORT ListRepositoryWebhookResult : public ServiceResult + { + public: + struct ResultItem + { + std::string description; + std::string lastTestResult; + bool pushEvents; + std::string createdAt; + long projectId; + bool tagPushEvents; + long id; + bool enableSslVerification; + bool noteEvents; + bool mergeRequestsEvents; + std::string url; + std::string secretToken; + }; + + + ListRepositoryWebhookResult(); + explicit ListRepositoryWebhookResult(const std::string &payload); + ~ListRepositoryWebhookResult(); + long getTotal()const; + std::string getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + std::vector getResult()const; + + protected: + void parse(const std::string &payload); + private: + long total_; + std::string errorCode_; + std::string errorMessage_; + bool success_; + std::vector result_; + + }; + } + } +} +#endif // !ALIBABACLOUD_CODEUP_MODEL_LISTREPOSITORYWEBHOOKRESULT_H_ \ No newline at end of file diff --git a/codeup/src/CodeupClient.cc b/codeup/src/CodeupClient.cc index f52a49ce9..18719007f 100644 --- a/codeup/src/CodeupClient.cc +++ b/codeup/src/CodeupClient.cc @@ -627,6 +627,42 @@ CodeupClient::DeleteRepositoryTagOutcomeCallable CodeupClient::deleteRepositoryT return task->get_future(); } +CodeupClient::DeleteRepositoryWebhookOutcome CodeupClient::deleteRepositoryWebhook(const DeleteRepositoryWebhookRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return DeleteRepositoryWebhookOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return DeleteRepositoryWebhookOutcome(DeleteRepositoryWebhookResult(outcome.result())); + else + return DeleteRepositoryWebhookOutcome(outcome.error()); +} + +void CodeupClient::deleteRepositoryWebhookAsync(const DeleteRepositoryWebhookRequest& request, const DeleteRepositoryWebhookAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, deleteRepositoryWebhook(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CodeupClient::DeleteRepositoryWebhookOutcomeCallable CodeupClient::deleteRepositoryWebhookCallable(const DeleteRepositoryWebhookRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->deleteRepositoryWebhook(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CodeupClient::GetBranchInfoOutcome CodeupClient::getBranchInfo(const GetBranchInfoRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -879,6 +915,42 @@ CodeupClient::GetRepositoryTagOutcomeCallable CodeupClient::getRepositoryTagCall return task->get_future(); } +CodeupClient::GetUserInfoOutcome CodeupClient::getUserInfo(const GetUserInfoRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetUserInfoOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetUserInfoOutcome(GetUserInfoResult(outcome.result())); + else + return GetUserInfoOutcome(outcome.error()); +} + +void CodeupClient::getUserInfoAsync(const GetUserInfoRequest& request, const GetUserInfoAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getUserInfo(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CodeupClient::GetUserInfoOutcomeCallable CodeupClient::getUserInfoCallable(const GetUserInfoRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getUserInfo(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CodeupClient::ListGroupMemberOutcome CodeupClient::listGroupMember(const ListGroupMemberRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -987,6 +1059,78 @@ CodeupClient::ListGroupsOutcomeCallable CodeupClient::listGroupsCallable(const L return task->get_future(); } +CodeupClient::ListOrganizationsOutcome CodeupClient::listOrganizations(const ListOrganizationsRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListOrganizationsOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListOrganizationsOutcome(ListOrganizationsResult(outcome.result())); + else + return ListOrganizationsOutcome(outcome.error()); +} + +void CodeupClient::listOrganizationsAsync(const ListOrganizationsRequest& request, const ListOrganizationsAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listOrganizations(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CodeupClient::ListOrganizationsOutcomeCallable CodeupClient::listOrganizationsCallable(const ListOrganizationsRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listOrganizations(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +CodeupClient::ListRepositoriesOutcome CodeupClient::listRepositories(const ListRepositoriesRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListRepositoriesOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListRepositoriesOutcome(ListRepositoriesResult(outcome.result())); + else + return ListRepositoriesOutcome(outcome.error()); +} + +void CodeupClient::listRepositoriesAsync(const ListRepositoriesRequest& request, const ListRepositoriesAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listRepositories(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CodeupClient::ListRepositoriesOutcomeCallable CodeupClient::listRepositoriesCallable(const ListRepositoriesRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listRepositories(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CodeupClient::ListRepositoryBranchesOutcome CodeupClient::listRepositoryBranches(const ListRepositoryBranchesRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); @@ -1131,6 +1275,42 @@ CodeupClient::ListRepositoryTreeOutcomeCallable CodeupClient::listRepositoryTree return task->get_future(); } +CodeupClient::ListRepositoryWebhookOutcome CodeupClient::listRepositoryWebhook(const ListRepositoryWebhookRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return ListRepositoryWebhookOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return ListRepositoryWebhookOutcome(ListRepositoryWebhookResult(outcome.result())); + else + return ListRepositoryWebhookOutcome(outcome.error()); +} + +void CodeupClient::listRepositoryWebhookAsync(const ListRepositoryWebhookRequest& request, const ListRepositoryWebhookAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, listRepositoryWebhook(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +CodeupClient::ListRepositoryWebhookOutcomeCallable CodeupClient::listRepositoryWebhookCallable(const ListRepositoryWebhookRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->listRepositoryWebhook(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + CodeupClient::MergeMergeRequestOutcome CodeupClient::mergeMergeRequest(const MergeMergeRequestRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/codeup/src/model/AddWebhookResult.cc b/codeup/src/model/AddWebhookResult.cc index a1a6d8ef7..736a42df8 100644 --- a/codeup/src/model/AddWebhookResult.cc +++ b/codeup/src/model/AddWebhookResult.cc @@ -66,6 +66,8 @@ void AddWebhookResult::parse(const std::string &payload) result_.lastTestResult = resultNode["LastTestResult"].asString(); if(!resultNode["Description"].isNull()) result_.description = resultNode["Description"].asString(); + if(!resultNode["SecretToken"].isNull()) + result_.secretToken = resultNode["SecretToken"].asString(); if(!value["ErrorCode"].isNull()) errorCode_ = value["ErrorCode"].asString(); if(!value["Success"].isNull()) diff --git a/codeup/src/model/DeleteRepositoryWebhookRequest.cc b/codeup/src/model/DeleteRepositoryWebhookRequest.cc new file mode 100644 index 000000000..67dccd3f0 --- /dev/null +++ b/codeup/src/model/DeleteRepositoryWebhookRequest.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 + +using AlibabaCloud::Codeup::Model::DeleteRepositoryWebhookRequest; + +DeleteRepositoryWebhookRequest::DeleteRepositoryWebhookRequest() : + RoaServiceRequest("codeup", "2020-04-14") +{ + setResourcePath("/api/v3/projects/[ProjectId]/hooks/[WebhookId]"); + setMethod(HttpRequest::Method::Delete); +} + +DeleteRepositoryWebhookRequest::~DeleteRepositoryWebhookRequest() +{} + +std::string DeleteRepositoryWebhookRequest::getOrganizationId()const +{ + return organizationId_; +} + +void DeleteRepositoryWebhookRequest::setOrganizationId(const std::string& organizationId) +{ + organizationId_ = organizationId; + setParameter("OrganizationId", organizationId); +} + +long DeleteRepositoryWebhookRequest::getWebhookId()const +{ + return webhookId_; +} + +void DeleteRepositoryWebhookRequest::setWebhookId(long webhookId) +{ + webhookId_ = webhookId; + setParameter("WebhookId", std::to_string(webhookId)); +} + +std::string DeleteRepositoryWebhookRequest::getAccessToken()const +{ + return accessToken_; +} + +void DeleteRepositoryWebhookRequest::setAccessToken(const std::string& accessToken) +{ + accessToken_ = accessToken; + setParameter("AccessToken", accessToken); +} + +long DeleteRepositoryWebhookRequest::getProjectId()const +{ + return projectId_; +} + +void DeleteRepositoryWebhookRequest::setProjectId(long projectId) +{ + projectId_ = projectId; + setParameter("ProjectId", std::to_string(projectId)); +} + diff --git a/codeup/src/model/DeleteRepositoryWebhookResult.cc b/codeup/src/model/DeleteRepositoryWebhookResult.cc new file mode 100644 index 000000000..e8a8918a2 --- /dev/null +++ b/codeup/src/model/DeleteRepositoryWebhookResult.cc @@ -0,0 +1,95 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Codeup; +using namespace AlibabaCloud::Codeup::Model; + +DeleteRepositoryWebhookResult::DeleteRepositoryWebhookResult() : + ServiceResult() +{} + +DeleteRepositoryWebhookResult::DeleteRepositoryWebhookResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +DeleteRepositoryWebhookResult::~DeleteRepositoryWebhookResult() +{} + +void DeleteRepositoryWebhookResult::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["Url"].isNull()) + result_.url = resultNode["Url"].asString(); + if(!resultNode["CreatedAt"].isNull()) + result_.createdAt = resultNode["CreatedAt"].asString(); + if(!resultNode["ProjectId"].isNull()) + result_.projectId = std::stol(resultNode["ProjectId"].asString()); + if(!resultNode["PushEvents"].isNull()) + result_.pushEvents = resultNode["PushEvents"].asString() == "true"; + if(!resultNode["MergeRequestsEvents"].isNull()) + result_.mergeRequestsEvents = resultNode["MergeRequestsEvents"].asString() == "true"; + if(!resultNode["TagPushEvents"].isNull()) + result_.tagPushEvents = resultNode["TagPushEvents"].asString() == "true"; + if(!resultNode["NoteEvents"].isNull()) + result_.noteEvents = resultNode["NoteEvents"].asString() == "true"; + if(!resultNode["EnableSslVerification"].isNull()) + result_.enableSslVerification = resultNode["EnableSslVerification"].asString() == "true"; + if(!resultNode["LastTestResult"].isNull()) + result_.lastTestResult = resultNode["LastTestResult"].asString(); + if(!resultNode["Description"].isNull()) + result_.description = resultNode["Description"].asString(); + if(!resultNode["SecretToken"].isNull()) + result_.secretToken = resultNode["SecretToken"].asString(); + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + +} + +std::string DeleteRepositoryWebhookResult::getErrorCode()const +{ + return errorCode_; +} + +std::string DeleteRepositoryWebhookResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool DeleteRepositoryWebhookResult::getSuccess()const +{ + return success_; +} + +DeleteRepositoryWebhookResult::Result DeleteRepositoryWebhookResult::getResult()const +{ + return result_; +} + diff --git a/codeup/src/model/GetUserInfoRequest.cc b/codeup/src/model/GetUserInfoRequest.cc new file mode 100644 index 000000000..7cfe13f38 --- /dev/null +++ b/codeup/src/model/GetUserInfoRequest.cc @@ -0,0 +1,41 @@ +/* + * 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 + +using AlibabaCloud::Codeup::Model::GetUserInfoRequest; + +GetUserInfoRequest::GetUserInfoRequest() : + RoaServiceRequest("codeup", "2020-04-14") +{ + setResourcePath("/api/v3/user/current"); + setMethod(HttpRequest::Method::Get); +} + +GetUserInfoRequest::~GetUserInfoRequest() +{} + +std::string GetUserInfoRequest::getAccessToken()const +{ + return accessToken_; +} + +void GetUserInfoRequest::setAccessToken(const std::string& accessToken) +{ + accessToken_ = accessToken; + setParameter("AccessToken", accessToken); +} + diff --git a/codeup/src/model/GetUserInfoResult.cc b/codeup/src/model/GetUserInfoResult.cc new file mode 100644 index 000000000..57458a780 --- /dev/null +++ b/codeup/src/model/GetUserInfoResult.cc @@ -0,0 +1,83 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Codeup; +using namespace AlibabaCloud::Codeup::Model; + +GetUserInfoResult::GetUserInfoResult() : + ServiceResult() +{} + +GetUserInfoResult::GetUserInfoResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetUserInfoResult::~GetUserInfoResult() +{} + +void GetUserInfoResult::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["ExternalUserId"].isNull()) + result_.externalUserId = resultNode["ExternalUserId"].asString(); + if(!resultNode["Username"].isNull()) + result_.username = resultNode["Username"].asString(); + if(!resultNode["Name"].isNull()) + result_.name = resultNode["Name"].asString(); + if(!resultNode["Email"].isNull()) + result_.email = resultNode["Email"].asString(); + if(!resultNode["AvatarUrl"].isNull()) + result_.avatarUrl = resultNode["AvatarUrl"].asString(); + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + +} + +std::string GetUserInfoResult::getErrorCode()const +{ + return errorCode_; +} + +std::string GetUserInfoResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool GetUserInfoResult::getSuccess()const +{ + return success_; +} + +GetUserInfoResult::Result GetUserInfoResult::getResult()const +{ + return result_; +} + diff --git a/codeup/src/model/ListOrganizationsRequest.cc b/codeup/src/model/ListOrganizationsRequest.cc new file mode 100644 index 000000000..5ba288812 --- /dev/null +++ b/codeup/src/model/ListOrganizationsRequest.cc @@ -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 + +using AlibabaCloud::Codeup::Model::ListOrganizationsRequest; + +ListOrganizationsRequest::ListOrganizationsRequest() : + RoaServiceRequest("codeup", "2020-04-14") +{ + setResourcePath("/api/v4/organization"); + setMethod(HttpRequest::Method::Get); +} + +ListOrganizationsRequest::~ListOrganizationsRequest() +{} + +int ListOrganizationsRequest::getAccessLevel()const +{ + return accessLevel_; +} + +void ListOrganizationsRequest::setAccessLevel(int accessLevel) +{ + accessLevel_ = accessLevel; + setParameter("AccessLevel", std::to_string(accessLevel)); +} + +int ListOrganizationsRequest::getMinAccessLevel()const +{ + return minAccessLevel_; +} + +void ListOrganizationsRequest::setMinAccessLevel(int minAccessLevel) +{ + minAccessLevel_ = minAccessLevel; + setParameter("MinAccessLevel", std::to_string(minAccessLevel)); +} + +std::string ListOrganizationsRequest::getAccessToken()const +{ + return accessToken_; +} + +void ListOrganizationsRequest::setAccessToken(const std::string& accessToken) +{ + accessToken_ = accessToken; + setParameter("AccessToken", accessToken); +} + diff --git a/codeup/src/model/ListOrganizationsResult.cc b/codeup/src/model/ListOrganizationsResult.cc new file mode 100644 index 000000000..bae7404a2 --- /dev/null +++ b/codeup/src/model/ListOrganizationsResult.cc @@ -0,0 +1,84 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +using namespace AlibabaCloud::Codeup; +using namespace AlibabaCloud::Codeup::Model; + +ListOrganizationsResult::ListOrganizationsResult() : + ServiceResult() +{} + +ListOrganizationsResult::ListOrganizationsResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListOrganizationsResult::~ListOrganizationsResult() +{} + +void ListOrganizationsResult::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["OrganizationId"].isNull()) + resultObject.organizationId = valueResultResultItem["OrganizationId"].asString(); + if(!valueResultResultItem["OrganizationName"].isNull()) + resultObject.organizationName = valueResultResultItem["OrganizationName"].asString(); + if(!valueResultResultItem["OrganizationRole"].isNull()) + resultObject.organizationRole = valueResultResultItem["OrganizationRole"].asString(); + if(!valueResultResultItem["AccessLevel"].isNull()) + resultObject.accessLevel = std::stoi(valueResultResultItem["AccessLevel"].asString()); + result_.push_back(resultObject); + } + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + +} + +std::string ListOrganizationsResult::getErrorCode()const +{ + return errorCode_; +} + +std::string ListOrganizationsResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool ListOrganizationsResult::getSuccess()const +{ + return success_; +} + +std::vector ListOrganizationsResult::getResult()const +{ + return result_; +} + diff --git a/codeup/src/model/ListRepositoriesRequest.cc b/codeup/src/model/ListRepositoriesRequest.cc new file mode 100644 index 000000000..8a6bd955b --- /dev/null +++ b/codeup/src/model/ListRepositoriesRequest.cc @@ -0,0 +1,118 @@ +/* + * 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 + +using AlibabaCloud::Codeup::Model::ListRepositoriesRequest; + +ListRepositoriesRequest::ListRepositoriesRequest() : + RoaServiceRequest("codeup", "2020-04-14") +{ + setResourcePath("/api/v3/projects/all"); + setMethod(HttpRequest::Method::Get); +} + +ListRepositoriesRequest::~ListRepositoriesRequest() +{} + +std::string ListRepositoriesRequest::getAccessToken()const +{ + return accessToken_; +} + +void ListRepositoriesRequest::setAccessToken(const std::string& accessToken) +{ + accessToken_ = accessToken; + setParameter("AccessToken", accessToken); +} + +bool ListRepositoriesRequest::getArchive()const +{ + return archive_; +} + +void ListRepositoriesRequest::setArchive(bool archive) +{ + archive_ = archive; + setParameter("Archive", archive ? "true" : "false"); +} + +std::string ListRepositoriesRequest::getSort()const +{ + return sort_; +} + +void ListRepositoriesRequest::setSort(const std::string& sort) +{ + sort_ = sort; + setParameter("Sort", sort); +} + +std::string ListRepositoriesRequest::getOrganizationId()const +{ + return organizationId_; +} + +void ListRepositoriesRequest::setOrganizationId(const std::string& organizationId) +{ + organizationId_ = organizationId; + setParameter("OrganizationId", organizationId); +} + +std::string ListRepositoriesRequest::getSearch()const +{ + return search_; +} + +void ListRepositoriesRequest::setSearch(const std::string& search) +{ + search_ = search; + setParameter("Search", search); +} + +long ListRepositoriesRequest::getPageSize()const +{ + return pageSize_; +} + +void ListRepositoriesRequest::setPageSize(long pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +long ListRepositoriesRequest::getPage()const +{ + return page_; +} + +void ListRepositoriesRequest::setPage(long page) +{ + page_ = page; + setParameter("Page", std::to_string(page)); +} + +std::string ListRepositoriesRequest::getOrder()const +{ + return order_; +} + +void ListRepositoriesRequest::setOrder(const std::string& order) +{ + order_ = order; + setParameter("Order", order); +} + diff --git a/codeup/src/model/ListRepositoriesResult.cc b/codeup/src/model/ListRepositoriesResult.cc new file mode 100644 index 000000000..3a6dc84bc --- /dev/null +++ b/codeup/src/model/ListRepositoriesResult.cc @@ -0,0 +1,121 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Codeup; +using namespace AlibabaCloud::Codeup::Model; + +ListRepositoriesResult::ListRepositoriesResult() : + ServiceResult() +{} + +ListRepositoriesResult::ListRepositoriesResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListRepositoriesResult::~ListRepositoriesResult() +{} + +void ListRepositoriesResult::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["Id"].isNull()) + resultObject.id = std::stol(valueResultResultItem["Id"].asString()); + if(!valueResultResultItem["Description"].isNull()) + resultObject.description = valueResultResultItem["Description"].asString(); + if(!valueResultResultItem["VisibilityLevel"].isNull()) + resultObject.visibilityLevel = valueResultResultItem["VisibilityLevel"].asString(); + if(!valueResultResultItem["WebUrl"].isNull()) + resultObject.webUrl = valueResultResultItem["WebUrl"].asString(); + if(!valueResultResultItem["Name"].isNull()) + resultObject.name = valueResultResultItem["Name"].asString(); + if(!valueResultResultItem["NameWithNamespace"].isNull()) + resultObject.nameWithNamespace = valueResultResultItem["NameWithNamespace"].asString(); + if(!valueResultResultItem["Path"].isNull()) + resultObject.path = valueResultResultItem["Path"].asString(); + if(!valueResultResultItem["PathWithNamespace"].isNull()) + resultObject.pathWithNamespace = valueResultResultItem["PathWithNamespace"].asString(); + if(!valueResultResultItem["CreatedAt"].isNull()) + resultObject.createdAt = valueResultResultItem["CreatedAt"].asString(); + if(!valueResultResultItem["LastActivityAt"].isNull()) + resultObject.lastActivityAt = valueResultResultItem["LastActivityAt"].asString(); + if(!valueResultResultItem["Archive"].isNull()) + resultObject.archive = valueResultResultItem["Archive"].asString() == "true"; + if(!valueResultResultItem["AvatarUrl"].isNull()) + resultObject.avatarUrl = valueResultResultItem["AvatarUrl"].asString(); + if(!valueResultResultItem["DemoProjectStatus"].isNull()) + resultObject.demoProjectStatus = valueResultResultItem["DemoProjectStatus"].asString() == "true"; + if(!valueResultResultItem["AccessLevel"].isNull()) + resultObject.accessLevel = std::stoi(valueResultResultItem["AccessLevel"].asString()); + if(!valueResultResultItem["ImportStatus"].isNull()) + resultObject.importStatus = valueResultResultItem["ImportStatus"].asString(); + if(!valueResultResultItem["NamespaceId"].isNull()) + resultObject.namespaceId = std::stol(valueResultResultItem["NamespaceId"].asString()); + if(!valueResultResultItem["UpdatedAt"].isNull()) + resultObject.updatedAt = valueResultResultItem["UpdatedAt"].asString(); + if(!valueResultResultItem["StarCount"].isNull()) + resultObject.starCount = std::stol(valueResultResultItem["StarCount"].asString()); + if(!valueResultResultItem["Star"].isNull()) + resultObject.star = valueResultResultItem["Star"].asString() == "true"; + result_.push_back(resultObject); + } + if(!value["ErrorCode"].isNull()) + errorCode_ = std::stoi(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 ListRepositoriesResult::getTotal()const +{ + return total_; +} + +int ListRepositoriesResult::getErrorCode()const +{ + return errorCode_; +} + +std::string ListRepositoriesResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool ListRepositoriesResult::getSuccess()const +{ + return success_; +} + +std::vector ListRepositoriesResult::getResult()const +{ + return result_; +} + diff --git a/codeup/src/model/ListRepositoryWebhookRequest.cc b/codeup/src/model/ListRepositoryWebhookRequest.cc new file mode 100644 index 000000000..8dab92bf5 --- /dev/null +++ b/codeup/src/model/ListRepositoryWebhookRequest.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 + +using AlibabaCloud::Codeup::Model::ListRepositoryWebhookRequest; + +ListRepositoryWebhookRequest::ListRepositoryWebhookRequest() : + RoaServiceRequest("codeup", "2020-04-14") +{ + setResourcePath("/api/v3/projects/[ProjectId]/hooks"); + setMethod(HttpRequest::Method::Get); +} + +ListRepositoryWebhookRequest::~ListRepositoryWebhookRequest() +{} + +std::string ListRepositoryWebhookRequest::getOrganizationId()const +{ + return organizationId_; +} + +void ListRepositoryWebhookRequest::setOrganizationId(const std::string& organizationId) +{ + organizationId_ = organizationId; + setParameter("OrganizationId", organizationId); +} + +long ListRepositoryWebhookRequest::getPageSize()const +{ + return pageSize_; +} + +void ListRepositoryWebhookRequest::setPageSize(long pageSize) +{ + pageSize_ = pageSize; + setParameter("PageSize", std::to_string(pageSize)); +} + +std::string ListRepositoryWebhookRequest::getAccessToken()const +{ + return accessToken_; +} + +void ListRepositoryWebhookRequest::setAccessToken(const std::string& accessToken) +{ + accessToken_ = accessToken; + setParameter("AccessToken", accessToken); +} + +long ListRepositoryWebhookRequest::getPage()const +{ + return page_; +} + +void ListRepositoryWebhookRequest::setPage(long page) +{ + page_ = page; + setParameter("Page", std::to_string(page)); +} + +long ListRepositoryWebhookRequest::getProjectId()const +{ + return projectId_; +} + +void ListRepositoryWebhookRequest::setProjectId(long projectId) +{ + projectId_ = projectId; + setParameter("ProjectId", std::to_string(projectId)); +} + diff --git a/codeup/src/model/ListRepositoryWebhookResult.cc b/codeup/src/model/ListRepositoryWebhookResult.cc new file mode 100644 index 000000000..df92d6543 --- /dev/null +++ b/codeup/src/model/ListRepositoryWebhookResult.cc @@ -0,0 +1,107 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Codeup; +using namespace AlibabaCloud::Codeup::Model; + +ListRepositoryWebhookResult::ListRepositoryWebhookResult() : + ServiceResult() +{} + +ListRepositoryWebhookResult::ListRepositoryWebhookResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +ListRepositoryWebhookResult::~ListRepositoryWebhookResult() +{} + +void ListRepositoryWebhookResult::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["Id"].isNull()) + resultObject.id = std::stol(valueResultResultItem["Id"].asString()); + if(!valueResultResultItem["Url"].isNull()) + resultObject.url = valueResultResultItem["Url"].asString(); + if(!valueResultResultItem["CreatedAt"].isNull()) + resultObject.createdAt = valueResultResultItem["CreatedAt"].asString(); + if(!valueResultResultItem["ProjectId"].isNull()) + resultObject.projectId = std::stol(valueResultResultItem["ProjectId"].asString()); + if(!valueResultResultItem["PushEvents"].isNull()) + resultObject.pushEvents = valueResultResultItem["PushEvents"].asString() == "true"; + if(!valueResultResultItem["MergeRequestsEvents"].isNull()) + resultObject.mergeRequestsEvents = valueResultResultItem["MergeRequestsEvents"].asString() == "true"; + if(!valueResultResultItem["TagPushEvents"].isNull()) + resultObject.tagPushEvents = valueResultResultItem["TagPushEvents"].asString() == "true"; + if(!valueResultResultItem["NoteEvents"].isNull()) + resultObject.noteEvents = valueResultResultItem["NoteEvents"].asString() == "true"; + if(!valueResultResultItem["EnableSslVerification"].isNull()) + resultObject.enableSslVerification = valueResultResultItem["EnableSslVerification"].asString() == "true"; + if(!valueResultResultItem["LastTestResult"].isNull()) + resultObject.lastTestResult = valueResultResultItem["LastTestResult"].asString(); + if(!valueResultResultItem["Description"].isNull()) + resultObject.description = valueResultResultItem["Description"].asString(); + if(!valueResultResultItem["SecretToken"].isNull()) + resultObject.secretToken = valueResultResultItem["SecretToken"].asString(); + result_.push_back(resultObject); + } + if(!value["ErrorCode"].isNull()) + errorCode_ = value["ErrorCode"].asString(); + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; + if(!value["ErrorMessage"].isNull()) + errorMessage_ = value["ErrorMessage"].asString(); + if(!value["Total"].isNull()) + total_ = std::stol(value["Total"].asString()); + +} + +long ListRepositoryWebhookResult::getTotal()const +{ + return total_; +} + +std::string ListRepositoryWebhookResult::getErrorCode()const +{ + return errorCode_; +} + +std::string ListRepositoryWebhookResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool ListRepositoryWebhookResult::getSuccess()const +{ + return success_; +} + +std::vector ListRepositoryWebhookResult::getResult()const +{ + return result_; +} +