diff --git a/CHANGELOG b/CHANGELOG index cac6e114c..367f9aae8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2021-01-21 Version: patch +- Add. + 2021-01-21 Version: patch - Supported RunInstances specifiy Dedicated Host Cluster Id. diff --git a/devops-rdc/CMakeLists.txt b/devops-rdc/CMakeLists.txt index 1e868bcba..8bf7ea218 100644 --- a/devops-rdc/CMakeLists.txt +++ b/devops-rdc/CMakeLists.txt @@ -69,6 +69,8 @@ set(devops-rdc_public_header_model include/alibabacloud/devops-rdc/model/GetDevopsProjectSprintInfoResult.h include/alibabacloud/devops-rdc/model/GetDevopsProjectTaskInfoRequest.h include/alibabacloud/devops-rdc/model/GetDevopsProjectTaskInfoResult.h + include/alibabacloud/devops-rdc/model/GetLastWorkspaceRequest.h + include/alibabacloud/devops-rdc/model/GetLastWorkspaceResult.h include/alibabacloud/devops-rdc/model/GetPipelineInstHistoryRequest.h include/alibabacloud/devops-rdc/model/GetPipelineInstHistoryResult.h include/alibabacloud/devops-rdc/model/GetPipelineInstanceBuildNumberStatusRequest.h @@ -194,6 +196,8 @@ set(devops-rdc_src src/model/GetDevopsProjectSprintInfoResult.cc src/model/GetDevopsProjectTaskInfoRequest.cc src/model/GetDevopsProjectTaskInfoResult.cc + src/model/GetLastWorkspaceRequest.cc + src/model/GetLastWorkspaceResult.cc src/model/GetPipelineInstHistoryRequest.cc src/model/GetPipelineInstHistoryResult.cc src/model/GetPipelineInstanceBuildNumberStatusRequest.cc diff --git a/devops-rdc/include/alibabacloud/devops-rdc/Devops_rdcClient.h b/devops-rdc/include/alibabacloud/devops-rdc/Devops_rdcClient.h index 55b97c109..c20b2b1c8 100644 --- a/devops-rdc/include/alibabacloud/devops-rdc/Devops_rdcClient.h +++ b/devops-rdc/include/alibabacloud/devops-rdc/Devops_rdcClient.h @@ -70,6 +70,8 @@ #include "model/GetDevopsProjectSprintInfoResult.h" #include "model/GetDevopsProjectTaskInfoRequest.h" #include "model/GetDevopsProjectTaskInfoResult.h" +#include "model/GetLastWorkspaceRequest.h" +#include "model/GetLastWorkspaceResult.h" #include "model/GetPipelineInstHistoryRequest.h" #include "model/GetPipelineInstHistoryResult.h" #include "model/GetPipelineInstanceBuildNumberStatusRequest.h" @@ -225,6 +227,9 @@ namespace AlibabaCloud typedef Outcome GetDevopsProjectTaskInfoOutcome; typedef std::future GetDevopsProjectTaskInfoOutcomeCallable; typedef std::function&)> GetDevopsProjectTaskInfoAsyncHandler; + typedef Outcome GetLastWorkspaceOutcome; + typedef std::future GetLastWorkspaceOutcomeCallable; + typedef std::function&)> GetLastWorkspaceAsyncHandler; typedef Outcome GetPipelineInstHistoryOutcome; typedef std::future GetPipelineInstHistoryOutcomeCallable; typedef std::function&)> GetPipelineInstHistoryAsyncHandler; @@ -413,6 +418,9 @@ namespace AlibabaCloud GetDevopsProjectTaskInfoOutcome getDevopsProjectTaskInfo(const Model::GetDevopsProjectTaskInfoRequest &request)const; void getDevopsProjectTaskInfoAsync(const Model::GetDevopsProjectTaskInfoRequest& request, const GetDevopsProjectTaskInfoAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDevopsProjectTaskInfoOutcomeCallable getDevopsProjectTaskInfoCallable(const Model::GetDevopsProjectTaskInfoRequest& request) const; + GetLastWorkspaceOutcome getLastWorkspace(const Model::GetLastWorkspaceRequest &request)const; + void getLastWorkspaceAsync(const Model::GetLastWorkspaceRequest& request, const GetLastWorkspaceAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetLastWorkspaceOutcomeCallable getLastWorkspaceCallable(const Model::GetLastWorkspaceRequest& request) const; GetPipelineInstHistoryOutcome getPipelineInstHistory(const Model::GetPipelineInstHistoryRequest &request)const; void getPipelineInstHistoryAsync(const Model::GetPipelineInstHistoryRequest& request, const GetPipelineInstHistoryAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetPipelineInstHistoryOutcomeCallable getPipelineInstHistoryCallable(const Model::GetPipelineInstHistoryRequest& request) const; diff --git a/devops-rdc/include/alibabacloud/devops-rdc/model/GetLastWorkspaceRequest.h b/devops-rdc/include/alibabacloud/devops-rdc/model/GetLastWorkspaceRequest.h new file mode 100644 index 000000000..bd36cea72 --- /dev/null +++ b/devops-rdc/include/alibabacloud/devops-rdc/model/GetLastWorkspaceRequest.h @@ -0,0 +1,51 @@ +/* + * 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_DEVOPS_RDC_MODEL_GETLASTWORKSPACEREQUEST_H_ +#define ALIBABACLOUD_DEVOPS_RDC_MODEL_GETLASTWORKSPACEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Devops_rdc + { + namespace Model + { + class ALIBABACLOUD_DEVOPS_RDC_EXPORT GetLastWorkspaceRequest : public RpcServiceRequest + { + + public: + GetLastWorkspaceRequest(); + ~GetLastWorkspaceRequest(); + + std::string getRealPk()const; + void setRealPk(const std::string& realPk); + std::string getOrgId()const; + void setOrgId(const std::string& orgId); + + private: + std::string realPk_; + std::string orgId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DEVOPS_RDC_MODEL_GETLASTWORKSPACEREQUEST_H_ \ No newline at end of file diff --git a/devops-rdc/include/alibabacloud/devops-rdc/model/GetLastWorkspaceResult.h b/devops-rdc/include/alibabacloud/devops-rdc/model/GetLastWorkspaceResult.h new file mode 100644 index 000000000..a03a51e08 --- /dev/null +++ b/devops-rdc/include/alibabacloud/devops-rdc/model/GetLastWorkspaceResult.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_DEVOPS_RDC_MODEL_GETLASTWORKSPACERESULT_H_ +#define ALIBABACLOUD_DEVOPS_RDC_MODEL_GETLASTWORKSPACERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Devops_rdc + { + namespace Model + { + class ALIBABACLOUD_DEVOPS_RDC_EXPORT GetLastWorkspaceResult : public ServiceResult + { + public: + + + GetLastWorkspaceResult(); + explicit GetLastWorkspaceResult(const std::string &payload); + ~GetLastWorkspaceResult(); + std::string getObject()const; + std::string getErrorCode()const; + std::string getErrorMessage()const; + bool getSuccess()const; + + protected: + void parse(const std::string &payload); + private: + std::string object_; + std::string errorCode_; + std::string errorMessage_; + bool success_; + + }; + } + } +} +#endif // !ALIBABACLOUD_DEVOPS_RDC_MODEL_GETLASTWORKSPACERESULT_H_ \ No newline at end of file diff --git a/devops-rdc/include/alibabacloud/devops-rdc/model/ListUserOrganizationResult.h b/devops-rdc/include/alibabacloud/devops-rdc/model/ListUserOrganizationResult.h index e9f9285c8..f7ee314a3 100644 --- a/devops-rdc/include/alibabacloud/devops-rdc/model/ListUserOrganizationResult.h +++ b/devops-rdc/include/alibabacloud/devops-rdc/model/ListUserOrganizationResult.h @@ -32,12 +32,17 @@ namespace AlibabaCloud class ALIBABACLOUD_DEVOPS_RDC_EXPORT ListUserOrganizationResult : public ServiceResult { public: + struct Organization + { + std::string id; + std::string name; + }; ListUserOrganizationResult(); explicit ListUserOrganizationResult(const std::string &payload); ~ListUserOrganizationResult(); - std::string getObject()const; + std::vector getObject()const; std::string getErrorCode()const; std::string getErrorMessage()const; bool getSuccess()const; @@ -45,7 +50,7 @@ namespace AlibabaCloud protected: void parse(const std::string &payload); private: - std::string object_; + std::vector object_; std::string errorCode_; std::string errorMessage_; bool success_; diff --git a/devops-rdc/src/Devops-rdcClient.cc b/devops-rdc/src/Devops-rdcClient.cc index 2b02ce276..dabe8de10 100644 --- a/devops-rdc/src/Devops-rdcClient.cc +++ b/devops-rdc/src/Devops-rdcClient.cc @@ -915,6 +915,42 @@ Devops_rdcClient::GetDevopsProjectTaskInfoOutcomeCallable Devops_rdcClient::getD return task->get_future(); } +Devops_rdcClient::GetLastWorkspaceOutcome Devops_rdcClient::getLastWorkspace(const GetLastWorkspaceRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetLastWorkspaceOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetLastWorkspaceOutcome(GetLastWorkspaceResult(outcome.result())); + else + return GetLastWorkspaceOutcome(outcome.error()); +} + +void Devops_rdcClient::getLastWorkspaceAsync(const GetLastWorkspaceRequest& request, const GetLastWorkspaceAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getLastWorkspace(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +Devops_rdcClient::GetLastWorkspaceOutcomeCallable Devops_rdcClient::getLastWorkspaceCallable(const GetLastWorkspaceRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getLastWorkspace(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + Devops_rdcClient::GetPipelineInstHistoryOutcome Devops_rdcClient::getPipelineInstHistory(const GetPipelineInstHistoryRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/devops-rdc/src/model/GetLastWorkspaceRequest.cc b/devops-rdc/src/model/GetLastWorkspaceRequest.cc new file mode 100644 index 000000000..54e90817b --- /dev/null +++ b/devops-rdc/src/model/GetLastWorkspaceRequest.cc @@ -0,0 +1,51 @@ +/* + * 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::Devops_rdc::Model::GetLastWorkspaceRequest; + +GetLastWorkspaceRequest::GetLastWorkspaceRequest() : + RpcServiceRequest("devops-rdc", "2020-03-03", "GetLastWorkspace") +{ + setMethod(HttpRequest::Method::Post); +} + +GetLastWorkspaceRequest::~GetLastWorkspaceRequest() +{} + +std::string GetLastWorkspaceRequest::getRealPk()const +{ + return realPk_; +} + +void GetLastWorkspaceRequest::setRealPk(const std::string& realPk) +{ + realPk_ = realPk; + setBodyParameter("RealPk", realPk); +} + +std::string GetLastWorkspaceRequest::getOrgId()const +{ + return orgId_; +} + +void GetLastWorkspaceRequest::setOrgId(const std::string& orgId) +{ + orgId_ = orgId; + setBodyParameter("OrgId", orgId); +} + diff --git a/devops-rdc/src/model/GetLastWorkspaceResult.cc b/devops-rdc/src/model/GetLastWorkspaceResult.cc new file mode 100644 index 000000000..d35e92da3 --- /dev/null +++ b/devops-rdc/src/model/GetLastWorkspaceResult.cc @@ -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. + */ + +#include +#include + +using namespace AlibabaCloud::Devops_rdc; +using namespace AlibabaCloud::Devops_rdc::Model; + +GetLastWorkspaceResult::GetLastWorkspaceResult() : + ServiceResult() +{} + +GetLastWorkspaceResult::GetLastWorkspaceResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetLastWorkspaceResult::~GetLastWorkspaceResult() +{} + +void GetLastWorkspaceResult::parse(const std::string &payload) +{ + Json::Reader reader; + Json::Value value; + reader.parse(payload, value); + setRequestId(value["RequestId"].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"; + if(!value["Object"].isNull()) + object_ = value["Object"].asString(); + +} + +std::string GetLastWorkspaceResult::getObject()const +{ + return object_; +} + +std::string GetLastWorkspaceResult::getErrorCode()const +{ + return errorCode_; +} + +std::string GetLastWorkspaceResult::getErrorMessage()const +{ + return errorMessage_; +} + +bool GetLastWorkspaceResult::getSuccess()const +{ + return success_; +} + diff --git a/devops-rdc/src/model/ListUserOrganizationResult.cc b/devops-rdc/src/model/ListUserOrganizationResult.cc index 4f1fa358c..64e0dce54 100644 --- a/devops-rdc/src/model/ListUserOrganizationResult.cc +++ b/devops-rdc/src/model/ListUserOrganizationResult.cc @@ -39,18 +39,26 @@ void ListUserOrganizationResult::parse(const std::string &payload) Json::Value value; reader.parse(payload, value); setRequestId(value["RequestId"].asString()); + auto allObjectNode = value["Object"]["Organization"]; + for (auto valueObjectOrganization : allObjectNode) + { + Organization objectObject; + if(!valueObjectOrganization["Name"].isNull()) + objectObject.name = valueObjectOrganization["Name"].asString(); + if(!valueObjectOrganization["Id"].isNull()) + objectObject.id = valueObjectOrganization["Id"].asString(); + object_.push_back(objectObject); + } + if(!value["Success"].isNull()) + success_ = value["Success"].asString() == "true"; if(!value["ErrorCode"].isNull()) errorCode_ = value["ErrorCode"].asString(); if(!value["ErrorMessage"].isNull()) errorMessage_ = value["ErrorMessage"].asString(); - if(!value["Success"].isNull()) - success_ = value["Success"].asString() == "true"; - if(!value["Object"].isNull()) - object_ = value["Object"].asString(); } -std::string ListUserOrganizationResult::getObject()const +std::vector ListUserOrganizationResult::getObject()const { return object_; }