This commit is contained in:
sdk-team
2021-01-21 06:23:25 +00:00
parent 65a6e6b64f
commit 6ff5b2e255
10 changed files with 302 additions and 7 deletions

View File

@@ -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<const AsyncCallerContext>& 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<std::packaged_task<GetLastWorkspaceOutcome()>>(
[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();

View File

@@ -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 <alibabacloud/devops-rdc/model/GetLastWorkspaceRequest.h>
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);
}

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/GetLastWorkspaceResult.h>
#include <json/json.h>
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_;
}

View File

@@ -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::Organization> ListUserOrganizationResult::getObject()const
{
return object_;
}