Move StartExecution params to body.

This commit is contained in:
sdk-team
2019-08-21 20:11:35 +08:00
parent 48eb3c101f
commit 6876310a85
5 changed files with 741 additions and 1 deletions

View File

@@ -1,3 +1,6 @@
2019-08-21 Version 1.36.93
- Move StartExecution params to body.
2019-08-21 Version 1.36.92
- Return backup job id when create backup.
- Return backup set size when describe backups.

View File

@@ -1 +1 @@
1.36.92
1.36.93

110
fnf/CMakeLists.txt Normal file
View File

@@ -0,0 +1,110 @@
#
# 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.
#
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
set(fnf_public_header
include/alibabacloud/fnf/FnfClient.h
include/alibabacloud/fnf/FnfExport.h )
set(fnf_public_header_model
include/alibabacloud/fnf/model/UpdateFlowRequest.h
include/alibabacloud/fnf/model/UpdateFlowResult.h
include/alibabacloud/fnf/model/ReportTaskFailedRequest.h
include/alibabacloud/fnf/model/ReportTaskFailedResult.h
include/alibabacloud/fnf/model/StopExecutionRequest.h
include/alibabacloud/fnf/model/StopExecutionResult.h
include/alibabacloud/fnf/model/StartExecutionRequest.h
include/alibabacloud/fnf/model/StartExecutionResult.h
include/alibabacloud/fnf/model/ListExecutionsRequest.h
include/alibabacloud/fnf/model/ListExecutionsResult.h
include/alibabacloud/fnf/model/ReportTaskSucceededRequest.h
include/alibabacloud/fnf/model/ReportTaskSucceededResult.h
include/alibabacloud/fnf/model/ListFlowsRequest.h
include/alibabacloud/fnf/model/ListFlowsResult.h )
set(fnf_src
src/FnfClient.cc
src/model/UpdateFlowRequest.cc
src/model/UpdateFlowResult.cc
src/model/ReportTaskFailedRequest.cc
src/model/ReportTaskFailedResult.cc
src/model/StopExecutionRequest.cc
src/model/StopExecutionResult.cc
src/model/StartExecutionRequest.cc
src/model/StartExecutionResult.cc
src/model/ListExecutionsRequest.cc
src/model/ListExecutionsResult.cc
src/model/ReportTaskSucceededRequest.cc
src/model/ReportTaskSucceededResult.cc
src/model/ListFlowsRequest.cc
src/model/ListFlowsResult.cc )
add_library(fnf ${LIB_TYPE}
${fnf_public_header}
${fnf_public_header_model}
${fnf_src})
set_target_properties(fnf
PROPERTIES
LINKER_LANGUAGE CXX
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}fnf
)
if(${LIB_TYPE} STREQUAL "SHARED")
set_target_properties(fnf
PROPERTIES
DEFINE_SYMBOL ALIBABACLOUD_FNF_LIBRARY)
endif()
target_include_directories(fnf
PRIVATE include
${CMAKE_SOURCE_DIR}/core/include
)
target_link_libraries(fnf
core)
if(CMAKE_HOST_WIN32)
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
set(jsoncpp_install_dir ${INSTALL_DIR})
add_dependencies(fnf
jsoncpp)
target_include_directories(fnf
PRIVATE ${jsoncpp_install_dir}/include)
target_link_libraries(fnf
${jsoncpp_install_dir}/lib/jsoncpp.lib)
set_target_properties(fnf
PROPERTIES
COMPILE_OPTIONS "/bigobj")
else()
target_include_directories(fnf
PRIVATE /usr/include/jsoncpp)
target_link_libraries(fnf
jsoncpp)
endif()
install(FILES ${fnf_public_header}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/fnf)
install(FILES ${fnf_public_header_model}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/fnf/model)
install(TARGETS fnf
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -0,0 +1,142 @@
/*
* 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_FNF_FNFCLIENT_H_
#define ALIBABACLOUD_FNF_FNFCLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "FnfExport.h"
#include "model/UpdateFlowRequest.h"
#include "model/UpdateFlowResult.h"
#include "model/DeleteFlowRequest.h"
#include "model/DeleteFlowResult.h"
#include "model/CreateFlowRequest.h"
#include "model/CreateFlowResult.h"
#include "model/DescribeExecutionRequest.h"
#include "model/DescribeExecutionResult.h"
#include "model/ReportTaskFailedRequest.h"
#include "model/ReportTaskFailedResult.h"
#include "model/DescribeFlowRequest.h"
#include "model/DescribeFlowResult.h"
#include "model/StopExecutionRequest.h"
#include "model/StopExecutionResult.h"
#include "model/StartExecutionRequest.h"
#include "model/StartExecutionResult.h"
#include "model/GetExecutionHistoryRequest.h"
#include "model/GetExecutionHistoryResult.h"
#include "model/ListExecutionsRequest.h"
#include "model/ListExecutionsResult.h"
#include "model/ReportTaskSucceededRequest.h"
#include "model/ReportTaskSucceededResult.h"
#include "model/ListFlowsRequest.h"
#include "model/ListFlowsResult.h"
namespace AlibabaCloud
{
namespace Fnf
{
class ALIBABACLOUD_FNF_EXPORT FnfClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::UpdateFlowResult> UpdateFlowOutcome;
typedef std::future<UpdateFlowOutcome> UpdateFlowOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::UpdateFlowRequest&, const UpdateFlowOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpdateFlowAsyncHandler;
typedef Outcome<Error, Model::DeleteFlowResult> DeleteFlowOutcome;
typedef std::future<DeleteFlowOutcome> DeleteFlowOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::DeleteFlowRequest&, const DeleteFlowOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DeleteFlowAsyncHandler;
typedef Outcome<Error, Model::CreateFlowResult> CreateFlowOutcome;
typedef std::future<CreateFlowOutcome> CreateFlowOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::CreateFlowRequest&, const CreateFlowOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateFlowAsyncHandler;
typedef Outcome<Error, Model::DescribeExecutionResult> DescribeExecutionOutcome;
typedef std::future<DescribeExecutionOutcome> DescribeExecutionOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::DescribeExecutionRequest&, const DescribeExecutionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeExecutionAsyncHandler;
typedef Outcome<Error, Model::ReportTaskFailedResult> ReportTaskFailedOutcome;
typedef std::future<ReportTaskFailedOutcome> ReportTaskFailedOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::ReportTaskFailedRequest&, const ReportTaskFailedOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReportTaskFailedAsyncHandler;
typedef Outcome<Error, Model::DescribeFlowResult> DescribeFlowOutcome;
typedef std::future<DescribeFlowOutcome> DescribeFlowOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::DescribeFlowRequest&, const DescribeFlowOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DescribeFlowAsyncHandler;
typedef Outcome<Error, Model::StopExecutionResult> StopExecutionOutcome;
typedef std::future<StopExecutionOutcome> StopExecutionOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::StopExecutionRequest&, const StopExecutionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StopExecutionAsyncHandler;
typedef Outcome<Error, Model::StartExecutionResult> StartExecutionOutcome;
typedef std::future<StartExecutionOutcome> StartExecutionOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::StartExecutionRequest&, const StartExecutionOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> StartExecutionAsyncHandler;
typedef Outcome<Error, Model::GetExecutionHistoryResult> GetExecutionHistoryOutcome;
typedef std::future<GetExecutionHistoryOutcome> GetExecutionHistoryOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::GetExecutionHistoryRequest&, const GetExecutionHistoryOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetExecutionHistoryAsyncHandler;
typedef Outcome<Error, Model::ListExecutionsResult> ListExecutionsOutcome;
typedef std::future<ListExecutionsOutcome> ListExecutionsOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::ListExecutionsRequest&, const ListExecutionsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListExecutionsAsyncHandler;
typedef Outcome<Error, Model::ReportTaskSucceededResult> ReportTaskSucceededOutcome;
typedef std::future<ReportTaskSucceededOutcome> ReportTaskSucceededOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::ReportTaskSucceededRequest&, const ReportTaskSucceededOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ReportTaskSucceededAsyncHandler;
typedef Outcome<Error, Model::ListFlowsResult> ListFlowsOutcome;
typedef std::future<ListFlowsOutcome> ListFlowsOutcomeCallable;
typedef std::function<void(const FnfClient*, const Model::ListFlowsRequest&, const ListFlowsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ListFlowsAsyncHandler;
FnfClient(const Credentials &credentials, const ClientConfiguration &configuration);
FnfClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
FnfClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~FnfClient();
UpdateFlowOutcome updateFlow(const Model::UpdateFlowRequest &request)const;
void updateFlowAsync(const Model::UpdateFlowRequest& request, const UpdateFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
UpdateFlowOutcomeCallable updateFlowCallable(const Model::UpdateFlowRequest& request) const;
DeleteFlowOutcome deleteFlow(const Model::DeleteFlowRequest &request)const;
void deleteFlowAsync(const Model::DeleteFlowRequest& request, const DeleteFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DeleteFlowOutcomeCallable deleteFlowCallable(const Model::DeleteFlowRequest& request) const;
CreateFlowOutcome createFlow(const Model::CreateFlowRequest &request)const;
void createFlowAsync(const Model::CreateFlowRequest& request, const CreateFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
CreateFlowOutcomeCallable createFlowCallable(const Model::CreateFlowRequest& request) const;
DescribeExecutionOutcome describeExecution(const Model::DescribeExecutionRequest &request)const;
void describeExecutionAsync(const Model::DescribeExecutionRequest& request, const DescribeExecutionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeExecutionOutcomeCallable describeExecutionCallable(const Model::DescribeExecutionRequest& request) const;
ReportTaskFailedOutcome reportTaskFailed(const Model::ReportTaskFailedRequest &request)const;
void reportTaskFailedAsync(const Model::ReportTaskFailedRequest& request, const ReportTaskFailedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ReportTaskFailedOutcomeCallable reportTaskFailedCallable(const Model::ReportTaskFailedRequest& request) const;
DescribeFlowOutcome describeFlow(const Model::DescribeFlowRequest &request)const;
void describeFlowAsync(const Model::DescribeFlowRequest& request, const DescribeFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
DescribeFlowOutcomeCallable describeFlowCallable(const Model::DescribeFlowRequest& request) const;
StopExecutionOutcome stopExecution(const Model::StopExecutionRequest &request)const;
void stopExecutionAsync(const Model::StopExecutionRequest& request, const StopExecutionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
StopExecutionOutcomeCallable stopExecutionCallable(const Model::StopExecutionRequest& request) const;
StartExecutionOutcome startExecution(const Model::StartExecutionRequest &request)const;
void startExecutionAsync(const Model::StartExecutionRequest& request, const StartExecutionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
StartExecutionOutcomeCallable startExecutionCallable(const Model::StartExecutionRequest& request) const;
GetExecutionHistoryOutcome getExecutionHistory(const Model::GetExecutionHistoryRequest &request)const;
void getExecutionHistoryAsync(const Model::GetExecutionHistoryRequest& request, const GetExecutionHistoryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
GetExecutionHistoryOutcomeCallable getExecutionHistoryCallable(const Model::GetExecutionHistoryRequest& request) const;
ListExecutionsOutcome listExecutions(const Model::ListExecutionsRequest &request)const;
void listExecutionsAsync(const Model::ListExecutionsRequest& request, const ListExecutionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListExecutionsOutcomeCallable listExecutionsCallable(const Model::ListExecutionsRequest& request) const;
ReportTaskSucceededOutcome reportTaskSucceeded(const Model::ReportTaskSucceededRequest &request)const;
void reportTaskSucceededAsync(const Model::ReportTaskSucceededRequest& request, const ReportTaskSucceededAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ReportTaskSucceededOutcomeCallable reportTaskSucceededCallable(const Model::ReportTaskSucceededRequest& request) const;
ListFlowsOutcome listFlows(const Model::ListFlowsRequest &request)const;
void listFlowsAsync(const Model::ListFlowsRequest& request, const ListFlowsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
ListFlowsOutcomeCallable listFlowsCallable(const Model::ListFlowsRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_FNF_FNFCLIENT_H_

485
fnf/src/FnfClient.cc Normal file
View File

@@ -0,0 +1,485 @@
/*
* 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/fnf/FnfClient.h>
#include <alibabacloud/core/SimpleCredentialsProvider.h>
using namespace AlibabaCloud;
using namespace AlibabaCloud::Location;
using namespace AlibabaCloud::Fnf;
using namespace AlibabaCloud::Fnf::Model;
namespace
{
const std::string SERVICE_NAME = "fnf";
}
FnfClient::FnfClient(const Credentials &credentials, const ClientConfiguration &configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "fnf");
}
FnfClient::FnfClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
{
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "fnf");
}
FnfClient::FnfClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
{
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "fnf");
}
FnfClient::~FnfClient()
{}
FnfClient::UpdateFlowOutcome FnfClient::updateFlow(const UpdateFlowRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return UpdateFlowOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return UpdateFlowOutcome(UpdateFlowResult(outcome.result()));
else
return UpdateFlowOutcome(outcome.error());
}
void FnfClient::updateFlowAsync(const UpdateFlowRequest& request, const UpdateFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, updateFlow(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::UpdateFlowOutcomeCallable FnfClient::updateFlowCallable(const UpdateFlowRequest &request) const
{
auto task = std::make_shared<std::packaged_task<UpdateFlowOutcome()>>(
[this, request]()
{
return this->updateFlow(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::DeleteFlowOutcome FnfClient::deleteFlow(const DeleteFlowRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DeleteFlowOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DeleteFlowOutcome(DeleteFlowResult(outcome.result()));
else
return DeleteFlowOutcome(outcome.error());
}
void FnfClient::deleteFlowAsync(const DeleteFlowRequest& request, const DeleteFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, deleteFlow(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::DeleteFlowOutcomeCallable FnfClient::deleteFlowCallable(const DeleteFlowRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DeleteFlowOutcome()>>(
[this, request]()
{
return this->deleteFlow(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::CreateFlowOutcome FnfClient::createFlow(const CreateFlowRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return CreateFlowOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return CreateFlowOutcome(CreateFlowResult(outcome.result()));
else
return CreateFlowOutcome(outcome.error());
}
void FnfClient::createFlowAsync(const CreateFlowRequest& request, const CreateFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, createFlow(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::CreateFlowOutcomeCallable FnfClient::createFlowCallable(const CreateFlowRequest &request) const
{
auto task = std::make_shared<std::packaged_task<CreateFlowOutcome()>>(
[this, request]()
{
return this->createFlow(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::DescribeExecutionOutcome FnfClient::describeExecution(const DescribeExecutionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeExecutionOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeExecutionOutcome(DescribeExecutionResult(outcome.result()));
else
return DescribeExecutionOutcome(outcome.error());
}
void FnfClient::describeExecutionAsync(const DescribeExecutionRequest& request, const DescribeExecutionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeExecution(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::DescribeExecutionOutcomeCallable FnfClient::describeExecutionCallable(const DescribeExecutionRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeExecutionOutcome()>>(
[this, request]()
{
return this->describeExecution(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::ReportTaskFailedOutcome FnfClient::reportTaskFailed(const ReportTaskFailedRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ReportTaskFailedOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ReportTaskFailedOutcome(ReportTaskFailedResult(outcome.result()));
else
return ReportTaskFailedOutcome(outcome.error());
}
void FnfClient::reportTaskFailedAsync(const ReportTaskFailedRequest& request, const ReportTaskFailedAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, reportTaskFailed(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::ReportTaskFailedOutcomeCallable FnfClient::reportTaskFailedCallable(const ReportTaskFailedRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ReportTaskFailedOutcome()>>(
[this, request]()
{
return this->reportTaskFailed(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::DescribeFlowOutcome FnfClient::describeFlow(const DescribeFlowRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return DescribeFlowOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return DescribeFlowOutcome(DescribeFlowResult(outcome.result()));
else
return DescribeFlowOutcome(outcome.error());
}
void FnfClient::describeFlowAsync(const DescribeFlowRequest& request, const DescribeFlowAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, describeFlow(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::DescribeFlowOutcomeCallable FnfClient::describeFlowCallable(const DescribeFlowRequest &request) const
{
auto task = std::make_shared<std::packaged_task<DescribeFlowOutcome()>>(
[this, request]()
{
return this->describeFlow(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::StopExecutionOutcome FnfClient::stopExecution(const StopExecutionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StopExecutionOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StopExecutionOutcome(StopExecutionResult(outcome.result()));
else
return StopExecutionOutcome(outcome.error());
}
void FnfClient::stopExecutionAsync(const StopExecutionRequest& request, const StopExecutionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, stopExecution(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::StopExecutionOutcomeCallable FnfClient::stopExecutionCallable(const StopExecutionRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StopExecutionOutcome()>>(
[this, request]()
{
return this->stopExecution(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::StartExecutionOutcome FnfClient::startExecution(const StartExecutionRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return StartExecutionOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return StartExecutionOutcome(StartExecutionResult(outcome.result()));
else
return StartExecutionOutcome(outcome.error());
}
void FnfClient::startExecutionAsync(const StartExecutionRequest& request, const StartExecutionAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, startExecution(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::StartExecutionOutcomeCallable FnfClient::startExecutionCallable(const StartExecutionRequest &request) const
{
auto task = std::make_shared<std::packaged_task<StartExecutionOutcome()>>(
[this, request]()
{
return this->startExecution(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::GetExecutionHistoryOutcome FnfClient::getExecutionHistory(const GetExecutionHistoryRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return GetExecutionHistoryOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return GetExecutionHistoryOutcome(GetExecutionHistoryResult(outcome.result()));
else
return GetExecutionHistoryOutcome(outcome.error());
}
void FnfClient::getExecutionHistoryAsync(const GetExecutionHistoryRequest& request, const GetExecutionHistoryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, getExecutionHistory(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::GetExecutionHistoryOutcomeCallable FnfClient::getExecutionHistoryCallable(const GetExecutionHistoryRequest &request) const
{
auto task = std::make_shared<std::packaged_task<GetExecutionHistoryOutcome()>>(
[this, request]()
{
return this->getExecutionHistory(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::ListExecutionsOutcome FnfClient::listExecutions(const ListExecutionsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListExecutionsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListExecutionsOutcome(ListExecutionsResult(outcome.result()));
else
return ListExecutionsOutcome(outcome.error());
}
void FnfClient::listExecutionsAsync(const ListExecutionsRequest& request, const ListExecutionsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listExecutions(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::ListExecutionsOutcomeCallable FnfClient::listExecutionsCallable(const ListExecutionsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListExecutionsOutcome()>>(
[this, request]()
{
return this->listExecutions(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::ReportTaskSucceededOutcome FnfClient::reportTaskSucceeded(const ReportTaskSucceededRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ReportTaskSucceededOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ReportTaskSucceededOutcome(ReportTaskSucceededResult(outcome.result()));
else
return ReportTaskSucceededOutcome(outcome.error());
}
void FnfClient::reportTaskSucceededAsync(const ReportTaskSucceededRequest& request, const ReportTaskSucceededAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, reportTaskSucceeded(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::ReportTaskSucceededOutcomeCallable FnfClient::reportTaskSucceededCallable(const ReportTaskSucceededRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ReportTaskSucceededOutcome()>>(
[this, request]()
{
return this->reportTaskSucceeded(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}
FnfClient::ListFlowsOutcome FnfClient::listFlows(const ListFlowsRequest &request) const
{
auto endpointOutcome = endpointProvider_->getEndpoint();
if (!endpointOutcome.isSuccess())
return ListFlowsOutcome(endpointOutcome.error());
auto outcome = makeRequest(endpointOutcome.result(), request);
if (outcome.isSuccess())
return ListFlowsOutcome(ListFlowsResult(outcome.result()));
else
return ListFlowsOutcome(outcome.error());
}
void FnfClient::listFlowsAsync(const ListFlowsRequest& request, const ListFlowsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
{
auto fn = [this, request, handler, context]()
{
handler(this, request, listFlows(request), context);
};
asyncExecute(new Runnable(fn));
}
FnfClient::ListFlowsOutcomeCallable FnfClient::listFlowsCallable(const ListFlowsRequest &request) const
{
auto task = std::make_shared<std::packaged_task<ListFlowsOutcome()>>(
[this, request]()
{
return this->listFlows(request);
});
asyncExecute(new Runnable([task]() { (*task)(); }));
return task->get_future();
}