Add list Organizations.

This commit is contained in:
sdk-team
2020-10-12 05:19:10 +00:00
parent 37fea59cb0
commit 11024b7871
8 changed files with 268 additions and 0 deletions

View File

@@ -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();

View File

@@ -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);
}

View File

@@ -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_;
}