瀏覽代碼

Add list Organizations.

sdk-team 6 年之前
父節點
當前提交
11024b7871

+ 3 - 0
CHANGELOG

@@ -1,3 +1,6 @@
+2020-10-12 Version: patch
+- Add list Organizations.
+
 2020-10-12 Version: patch
 - Init.
 

+ 4 - 0
devops-rdc/CMakeLists.txt

@@ -97,6 +97,8 @@ set(devops-rdc_public_header_model
 	include/alibabacloud/devops-rdc/model/ListPipelinesResult.h
 	include/alibabacloud/devops-rdc/model/ListServiceConnectionsRequest.h
 	include/alibabacloud/devops-rdc/model/ListServiceConnectionsResult.h
+	include/alibabacloud/devops-rdc/model/ListUserOrganizationRequest.h
+	include/alibabacloud/devops-rdc/model/ListUserOrganizationResult.h
 	include/alibabacloud/devops-rdc/model/UpdateDevopsProjectRequest.h
 	include/alibabacloud/devops-rdc/model/UpdateDevopsProjectResult.h
 	include/alibabacloud/devops-rdc/model/UpdateDevopsProjectSprintRequest.h
@@ -182,6 +184,8 @@ set(devops-rdc_src
 	src/model/ListPipelinesResult.cc
 	src/model/ListServiceConnectionsRequest.cc
 	src/model/ListServiceConnectionsResult.cc
+	src/model/ListUserOrganizationRequest.cc
+	src/model/ListUserOrganizationResult.cc
 	src/model/UpdateDevopsProjectRequest.cc
 	src/model/UpdateDevopsProjectResult.cc
 	src/model/UpdateDevopsProjectSprintRequest.cc

+ 8 - 0
devops-rdc/include/alibabacloud/devops-rdc/Devops_rdcClient.h

@@ -98,6 +98,8 @@
 #include "model/ListPipelinesResult.h"
 #include "model/ListServiceConnectionsRequest.h"
 #include "model/ListServiceConnectionsResult.h"
+#include "model/ListUserOrganizationRequest.h"
+#include "model/ListUserOrganizationResult.h"
 #include "model/UpdateDevopsProjectRequest.h"
 #include "model/UpdateDevopsProjectResult.h"
 #include "model/UpdateDevopsProjectSprintRequest.h"
@@ -227,6 +229,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::ListServiceConnectionsResult> ListServiceConnectionsOutcome;
 			typedef std::future<ListServiceConnectionsOutcome> ListServiceConnectionsOutcomeCallable;
 			typedef std::function<void(const Devops_rdcClient*, const Model::ListServiceConnectionsRequest&, const ListServiceConnectionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListServiceConnectionsAsyncHandler;
+			typedef Outcome<Error, Model::ListUserOrganizationResult> ListUserOrganizationOutcome;
+			typedef std::future<ListUserOrganizationOutcome> ListUserOrganizationOutcomeCallable;
+			typedef std::function<void(const Devops_rdcClient*, const Model::ListUserOrganizationRequest&, const ListUserOrganizationOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListUserOrganizationAsyncHandler;
 			typedef Outcome<Error, Model::UpdateDevopsProjectResult> UpdateDevopsProjectOutcome;
 			typedef std::future<UpdateDevopsProjectOutcome> UpdateDevopsProjectOutcomeCallable;
 			typedef std::function<void(const Devops_rdcClient*, const Model::UpdateDevopsProjectRequest&, const UpdateDevopsProjectOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpdateDevopsProjectAsyncHandler;
@@ -355,6 +360,9 @@ namespace AlibabaCloud
 			ListServiceConnectionsOutcome listServiceConnections(const Model::ListServiceConnectionsRequest &request)const;
 			void listServiceConnectionsAsync(const Model::ListServiceConnectionsRequest& request, const ListServiceConnectionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			ListServiceConnectionsOutcomeCallable listServiceConnectionsCallable(const Model::ListServiceConnectionsRequest& request) const;
+			ListUserOrganizationOutcome listUserOrganization(const Model::ListUserOrganizationRequest &request)const;
+			void listUserOrganizationAsync(const Model::ListUserOrganizationRequest& request, const ListUserOrganizationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			ListUserOrganizationOutcomeCallable listUserOrganizationCallable(const Model::ListUserOrganizationRequest& request) const;
 			UpdateDevopsProjectOutcome updateDevopsProject(const Model::UpdateDevopsProjectRequest &request)const;
 			void updateDevopsProjectAsync(const Model::UpdateDevopsProjectRequest& request, const UpdateDevopsProjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			UpdateDevopsProjectOutcomeCallable updateDevopsProjectCallable(const Model::UpdateDevopsProjectRequest& request) const;

+ 48 - 0
devops-rdc/include/alibabacloud/devops-rdc/model/ListUserOrganizationRequest.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_DEVOPS_RDC_MODEL_LISTUSERORGANIZATIONREQUEST_H_
+#define ALIBABACLOUD_DEVOPS_RDC_MODEL_LISTUSERORGANIZATIONREQUEST_H_
+
+#include <string>
+#include <vector>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <alibabacloud/devops-rdc/Devops_rdcExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Devops_rdc
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DEVOPS_RDC_EXPORT ListUserOrganizationRequest : public RpcServiceRequest
+			{
+
+			public:
+				ListUserOrganizationRequest();
+				~ListUserOrganizationRequest();
+
+				std::string getRealPk()const;
+				void setRealPk(const std::string& realPk);
+
+            private:
+				std::string realPk_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_DEVOPS_RDC_MODEL_LISTUSERORGANIZATIONREQUEST_H_

+ 57 - 0
devops-rdc/include/alibabacloud/devops-rdc/model/ListUserOrganizationResult.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_LISTUSERORGANIZATIONRESULT_H_
+#define ALIBABACLOUD_DEVOPS_RDC_MODEL_LISTUSERORGANIZATIONRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/devops-rdc/Devops_rdcExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Devops_rdc
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_DEVOPS_RDC_EXPORT ListUserOrganizationResult : public ServiceResult
+			{
+			public:
+
+
+				ListUserOrganizationResult();
+				explicit ListUserOrganizationResult(const std::string &payload);
+				~ListUserOrganizationResult();
+				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_LISTUSERORGANIZATIONRESULT_H_

+ 36 - 0
devops-rdc/src/Devops-rdcClient.cc

@@ -1419,6 +1419,42 @@ Devops_rdcClient::ListServiceConnectionsOutcomeCallable Devops_rdcClient::listSe
 	return task->get_future();
 }
 
+Devops_rdcClient::ListUserOrganizationOutcome Devops_rdcClient::listUserOrganization(const ListUserOrganizationRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return ListUserOrganizationOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return ListUserOrganizationOutcome(ListUserOrganizationResult(outcome.result()));
+	else
+		return ListUserOrganizationOutcome(outcome.error());
+}
+
+void Devops_rdcClient::listUserOrganizationAsync(const ListUserOrganizationRequest& request, const ListUserOrganizationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, listUserOrganization(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+Devops_rdcClient::ListUserOrganizationOutcomeCallable Devops_rdcClient::listUserOrganizationCallable(const ListUserOrganizationRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<ListUserOrganizationOutcome()>>(
+			[this, request]()
+			{
+			return this->listUserOrganization(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 Devops_rdcClient::UpdateDevopsProjectOutcome Devops_rdcClient::updateDevopsProject(const UpdateDevopsProjectRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 40 - 0
devops-rdc/src/model/ListUserOrganizationRequest.cc

@@ -0,0 +1,40 @@
+/*
+ * 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/devops-rdc/model/ListUserOrganizationRequest.h>
+
+using AlibabaCloud::Devops_rdc::Model::ListUserOrganizationRequest;
+
+ListUserOrganizationRequest::ListUserOrganizationRequest() :
+	RpcServiceRequest("devops-rdc", "2020-03-03", "ListUserOrganization")
+{
+	setMethod(HttpRequest::Method::Post);
+}
+
+ListUserOrganizationRequest::~ListUserOrganizationRequest()
+{}
+
+std::string ListUserOrganizationRequest::getRealPk()const
+{
+	return realPk_;
+}
+
+void ListUserOrganizationRequest::setRealPk(const std::string& realPk)
+{
+	realPk_ = realPk;
+	setBodyParameter("RealPk", realPk);
+}
+

+ 72 - 0
devops-rdc/src/model/ListUserOrganizationResult.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 <alibabacloud/devops-rdc/model/ListUserOrganizationResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Devops_rdc;
+using namespace AlibabaCloud::Devops_rdc::Model;
+
+ListUserOrganizationResult::ListUserOrganizationResult() :
+	ServiceResult()
+{}
+
+ListUserOrganizationResult::ListUserOrganizationResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+ListUserOrganizationResult::~ListUserOrganizationResult()
+{}
+
+void ListUserOrganizationResult::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 ListUserOrganizationResult::getObject()const
+{
+	return object_;
+}
+
+std::string ListUserOrganizationResult::getErrorCode()const
+{
+	return errorCode_;
+}
+
+std::string ListUserOrganizationResult::getErrorMessage()const
+{
+	return errorMessage_;
+}
+
+bool ListUserOrganizationResult::getSuccess()const
+{
+	return success_;
+}
+