Add API OfflineTaskFlow.

This commit is contained in:
sdk-team
2022-04-21 02:40:30 +00:00
parent e2f241db26
commit 68ed888149
9 changed files with 262 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2022-04-21 Version: 1.36.1109
- Add API OfflineTaskFlow.
2022-04-19 Version: 1.36.1108
- Generated 2018-12-03 for `Sas`.

View File

@@ -1 +1 @@
1.36.1108
1.36.1109

View File

@@ -237,6 +237,8 @@ set(dms-enterprise_public_header_model
include/alibabacloud/dms-enterprise/model/ListWorkFlowTemplatesResult.h
include/alibabacloud/dms-enterprise/model/ModifyDataCorrectExecSQLRequest.h
include/alibabacloud/dms-enterprise/model/ModifyDataCorrectExecSQLResult.h
include/alibabacloud/dms-enterprise/model/OfflineTaskFlowRequest.h
include/alibabacloud/dms-enterprise/model/OfflineTaskFlowResult.h
include/alibabacloud/dms-enterprise/model/PauseDataCorrectSQLJobRequest.h
include/alibabacloud/dms-enterprise/model/PauseDataCorrectSQLJobResult.h
include/alibabacloud/dms-enterprise/model/ReDeployLhDagVersionRequest.h
@@ -488,6 +490,8 @@ set(dms-enterprise_src
src/model/ListWorkFlowTemplatesResult.cc
src/model/ModifyDataCorrectExecSQLRequest.cc
src/model/ModifyDataCorrectExecSQLResult.cc
src/model/OfflineTaskFlowRequest.cc
src/model/OfflineTaskFlowResult.cc
src/model/PauseDataCorrectSQLJobRequest.cc
src/model/PauseDataCorrectSQLJobResult.cc
src/model/ReDeployLhDagVersionRequest.cc

View File

@@ -238,6 +238,8 @@
#include "model/ListWorkFlowTemplatesResult.h"
#include "model/ModifyDataCorrectExecSQLRequest.h"
#include "model/ModifyDataCorrectExecSQLResult.h"
#include "model/OfflineTaskFlowRequest.h"
#include "model/OfflineTaskFlowResult.h"
#include "model/PauseDataCorrectSQLJobRequest.h"
#include "model/PauseDataCorrectSQLJobResult.h"
#include "model/ReDeployLhDagVersionRequest.h"
@@ -603,6 +605,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::ModifyDataCorrectExecSQLResult> ModifyDataCorrectExecSQLOutcome;
typedef std::future<ModifyDataCorrectExecSQLOutcome> ModifyDataCorrectExecSQLOutcomeCallable;
typedef std::function<void(const Dms_enterpriseClient*, const Model::ModifyDataCorrectExecSQLRequest&, const ModifyDataCorrectExecSQLOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ModifyDataCorrectExecSQLAsyncHandler;
typedef Outcome<Error, Model::OfflineTaskFlowResult> OfflineTaskFlowOutcome;
typedef std::future<OfflineTaskFlowOutcome> OfflineTaskFlowOutcomeCallable;
typedef std::function<void(const Dms_enterpriseClient*, const Model::OfflineTaskFlowRequest&, const OfflineTaskFlowOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> OfflineTaskFlowAsyncHandler;
typedef Outcome<Error, Model::PauseDataCorrectSQLJobResult> PauseDataCorrectSQLJobOutcome;
typedef std::future<PauseDataCorrectSQLJobOutcome> PauseDataCorrectSQLJobOutcomeCallable;
typedef std::function<void(const Dms_enterpriseClient*, const Model::PauseDataCorrectSQLJobRequest&, const PauseDataCorrectSQLJobOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PauseDataCorrectSQLJobAsyncHandler;
@@ -980,6 +985,9 @@ namespace AlibabaCloud
ModifyDataCorrectExecSQLOutcome modifyDataCorrectExecSQL(const Model::ModifyDataCorrectExecSQLRequest &request)const;
void modifyDataCorrectExecSQLAsync(const Model::ModifyDataCorrectExecSQLRequest& request, const ModifyDataCorrectExecSQLAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ModifyDataCorrectExecSQLOutcomeCallable modifyDataCorrectExecSQLCallable(const Model::ModifyDataCorrectExecSQLRequest& request) const;
OfflineTaskFlowOutcome offlineTaskFlow(const Model::OfflineTaskFlowRequest &request)const;
void offlineTaskFlowAsync(const Model::OfflineTaskFlowRequest& request, const OfflineTaskFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
OfflineTaskFlowOutcomeCallable offlineTaskFlowCallable(const Model::OfflineTaskFlowRequest& request) const;
PauseDataCorrectSQLJobOutcome pauseDataCorrectSQLJob(const Model::PauseDataCorrectSQLJobRequest &request)const;
void pauseDataCorrectSQLJobAsync(const Model::PauseDataCorrectSQLJobRequest& request, const PauseDataCorrectSQLJobAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
PauseDataCorrectSQLJobOutcomeCallable pauseDataCorrectSQLJobCallable(const Model::PauseDataCorrectSQLJobRequest& request) const;

View File

@@ -0,0 +1,45 @@
/*
* 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_DMS_ENTERPRISE_MODEL_OFFLINETASKFLOWREQUEST_H_
#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_OFFLINETASKFLOWREQUEST_H_
#include <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <string>
#include <vector>
#include <map>
namespace AlibabaCloud {
namespace Dms_enterprise {
namespace Model {
class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT OfflineTaskFlowRequest : public RpcServiceRequest {
public:
OfflineTaskFlowRequest();
~OfflineTaskFlowRequest();
long getDagId() const;
void setDagId(long dagId);
long getTid() const;
void setTid(long tid);
private:
long dagId_;
long tid_;
};
} // namespace Model
} // namespace Dms_enterprise
} // namespace AlibabaCloud
#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_OFFLINETASKFLOWREQUEST_H_

View File

@@ -0,0 +1,55 @@
/*
* 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_DMS_ENTERPRISE_MODEL_OFFLINETASKFLOWRESULT_H_
#define ALIBABACLOUD_DMS_ENTERPRISE_MODEL_OFFLINETASKFLOWRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/dms-enterprise/Dms_enterpriseExport.h>
namespace AlibabaCloud
{
namespace Dms_enterprise
{
namespace Model
{
class ALIBABACLOUD_DMS_ENTERPRISE_EXPORT OfflineTaskFlowResult : public ServiceResult
{
public:
OfflineTaskFlowResult();
explicit OfflineTaskFlowResult(const std::string &payload);
~OfflineTaskFlowResult();
std::string getErrorCode()const;
std::string getErrorMessage()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
std::string errorCode_;
std::string errorMessage_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_DMS_ENTERPRISE_MODEL_OFFLINETASKFLOWRESULT_H_

View File

@@ -3939,6 +3939,42 @@ Dms_enterpriseClient::ModifyDataCorrectExecSQLOutcomeCallable Dms_enterpriseClie
return task->get_future();
}
Dms_enterpriseClient::OfflineTaskFlowOutcome Dms_enterpriseClient::offlineTaskFlow(const OfflineTaskFlowRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return OfflineTaskFlowOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return OfflineTaskFlowOutcome(OfflineTaskFlowResult(outcome.result()));
else
return OfflineTaskFlowOutcome(outcome.error());
}
void Dms_enterpriseClient::offlineTaskFlowAsync(const OfflineTaskFlowRequest& request, const OfflineTaskFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, offlineTaskFlow(request), context);
};
asyncExecute(new Runnable(fn));
}
Dms_enterpriseClient::OfflineTaskFlowOutcomeCallable Dms_enterpriseClient::offlineTaskFlowCallable(const OfflineTaskFlowRequest &request) const
{
auto task = std::make_shared<std::packaged_task<OfflineTaskFlowOutcome()>>(
[this, request]()
{
return this->offlineTaskFlow(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
Dms_enterpriseClient::PauseDataCorrectSQLJobOutcome Dms_enterpriseClient::pauseDataCorrectSQLJob(const PauseDataCorrectSQLJobRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();

View File

@@ -0,0 +1,45 @@
/*
* 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/dms-enterprise/model/OfflineTaskFlowRequest.h>
using AlibabaCloud::Dms_enterprise::Model::OfflineTaskFlowRequest;
OfflineTaskFlowRequest::OfflineTaskFlowRequest()
: RpcServiceRequest("dms-enterprise", "2018-11-01", "OfflineTaskFlow") {
setMethod(HttpRequest::Method::Post);
}
OfflineTaskFlowRequest::~OfflineTaskFlowRequest() {}
long OfflineTaskFlowRequest::getDagId() const {
return dagId_;
}
void OfflineTaskFlowRequest::setDagId(long dagId) {
dagId_ = dagId;
setParameter(std::string("DagId"), std::to_string(dagId));
}
long OfflineTaskFlowRequest::getTid() const {
return tid_;
}
void OfflineTaskFlowRequest::setTid(long tid) {
tid_ = tid;
setParameter(std::string("Tid"), std::to_string(tid));
}

View File

@@ -0,0 +1,65 @@
/*
* 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/dms-enterprise/model/OfflineTaskFlowResult.h>
#include <json/json.h>
using namespace AlibabaCloud::Dms_enterprise;
using namespace AlibabaCloud::Dms_enterprise::Model;
OfflineTaskFlowResult::OfflineTaskFlowResult() :
ServiceResult()
{}
OfflineTaskFlowResult::OfflineTaskFlowResult(const std::string &payload) :
ServiceResult()
{
parse(payload);
}
OfflineTaskFlowResult::~OfflineTaskFlowResult()
{}
void OfflineTaskFlowResult::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";
}
std::string OfflineTaskFlowResult::getErrorCode()const
{
return errorCode_;
}
std::string OfflineTaskFlowResult::getErrorMessage()const
{
return errorMessage_;
}
bool OfflineTaskFlowResult::getSuccess()const
{
return success_;
}