Supported Add GetAlgorithmHistoryResult.
This commit is contained in:
102
industry-brain/CMakeLists.txt
Normal file
102
industry-brain/CMakeLists.txt
Normal file
@@ -0,0 +1,102 @@
|
||||
#
|
||||
# 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(industry-brain_public_header
|
||||
include/alibabacloud/industry-brain/Industry_brainClient.h
|
||||
include/alibabacloud/industry-brain/Industry_brainExport.h )
|
||||
|
||||
set(industry-brain_public_header_model
|
||||
include/alibabacloud/industry-brain/model/AsyncResponsePostRequest.h
|
||||
include/alibabacloud/industry-brain/model/AsyncResponsePostResult.h
|
||||
include/alibabacloud/industry-brain/model/GetAlgorithmHistoryResultRequest.h
|
||||
include/alibabacloud/industry-brain/model/GetAlgorithmHistoryResultResult.h
|
||||
include/alibabacloud/industry-brain/model/GetServiceResultAsyncRequest.h
|
||||
include/alibabacloud/industry-brain/model/GetServiceResultAsyncResult.h
|
||||
include/alibabacloud/industry-brain/model/InvokeServiceRequest.h
|
||||
include/alibabacloud/industry-brain/model/InvokeServiceResult.h
|
||||
include/alibabacloud/industry-brain/model/InvokeServiceAsyncRequest.h
|
||||
include/alibabacloud/industry-brain/model/InvokeServiceAsyncResult.h )
|
||||
|
||||
set(industry-brain_src
|
||||
src/Industry-brainClient.cc
|
||||
src/model/AsyncResponsePostRequest.cc
|
||||
src/model/AsyncResponsePostResult.cc
|
||||
src/model/GetAlgorithmHistoryResultRequest.cc
|
||||
src/model/GetAlgorithmHistoryResultResult.cc
|
||||
src/model/GetServiceResultAsyncRequest.cc
|
||||
src/model/GetServiceResultAsyncResult.cc
|
||||
src/model/InvokeServiceRequest.cc
|
||||
src/model/InvokeServiceResult.cc
|
||||
src/model/InvokeServiceAsyncRequest.cc
|
||||
src/model/InvokeServiceAsyncResult.cc )
|
||||
|
||||
add_library(industry-brain ${LIB_TYPE}
|
||||
${industry-brain_public_header}
|
||||
${industry-brain_public_header_model}
|
||||
${industry-brain_src})
|
||||
|
||||
set_target_properties(industry-brain
|
||||
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}industry-brain
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(industry-brain
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_INDUSTRY_BRAIN_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(industry-brain
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(industry-brain
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(industry-brain
|
||||
jsoncpp)
|
||||
target_include_directories(industry-brain
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(industry-brain
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(industry-brain
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(industry-brain
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(industry-brain
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${industry-brain_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/industry-brain)
|
||||
install(FILES ${industry-brain_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/industry-brain/model)
|
||||
install(TARGETS industry-brain
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* 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_INDUSTRY_BRAIN_INDUSTRY_BRAINCLIENT_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_INDUSTRY_BRAINCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "Industry_brainExport.h"
|
||||
#include "model/AsyncResponsePostRequest.h"
|
||||
#include "model/AsyncResponsePostResult.h"
|
||||
#include "model/GetAlgorithmHistoryResultRequest.h"
|
||||
#include "model/GetAlgorithmHistoryResultResult.h"
|
||||
#include "model/GetServiceResultAsyncRequest.h"
|
||||
#include "model/GetServiceResultAsyncResult.h"
|
||||
#include "model/InvokeServiceRequest.h"
|
||||
#include "model/InvokeServiceResult.h"
|
||||
#include "model/InvokeServiceAsyncRequest.h"
|
||||
#include "model/InvokeServiceAsyncResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT Industry_brainClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::AsyncResponsePostResult> AsyncResponsePostOutcome;
|
||||
typedef std::future<AsyncResponsePostOutcome> AsyncResponsePostOutcomeCallable;
|
||||
typedef std::function<void(const Industry_brainClient*, const Model::AsyncResponsePostRequest&, const AsyncResponsePostOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AsyncResponsePostAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetAlgorithmHistoryResultResult> GetAlgorithmHistoryResultOutcome;
|
||||
typedef std::future<GetAlgorithmHistoryResultOutcome> GetAlgorithmHistoryResultOutcomeCallable;
|
||||
typedef std::function<void(const Industry_brainClient*, const Model::GetAlgorithmHistoryResultRequest&, const GetAlgorithmHistoryResultOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetAlgorithmHistoryResultAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetServiceResultAsyncResult> GetServiceResultAsyncOutcome;
|
||||
typedef std::future<GetServiceResultAsyncOutcome> GetServiceResultAsyncOutcomeCallable;
|
||||
typedef std::function<void(const Industry_brainClient*, const Model::GetServiceResultAsyncRequest&, const GetServiceResultAsyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetServiceResultAsyncAsyncHandler;
|
||||
typedef Outcome<Error, Model::InvokeServiceResult> InvokeServiceOutcome;
|
||||
typedef std::future<InvokeServiceOutcome> InvokeServiceOutcomeCallable;
|
||||
typedef std::function<void(const Industry_brainClient*, const Model::InvokeServiceRequest&, const InvokeServiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> InvokeServiceAsyncHandler;
|
||||
typedef Outcome<Error, Model::InvokeServiceAsyncResult> InvokeServiceAsyncOutcome;
|
||||
typedef std::future<InvokeServiceAsyncOutcome> InvokeServiceAsyncOutcomeCallable;
|
||||
typedef std::function<void(const Industry_brainClient*, const Model::InvokeServiceAsyncRequest&, const InvokeServiceAsyncOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> InvokeServiceAsyncAsyncHandler;
|
||||
|
||||
Industry_brainClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
Industry_brainClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
Industry_brainClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~Industry_brainClient();
|
||||
AsyncResponsePostOutcome asyncResponsePost(const Model::AsyncResponsePostRequest &request)const;
|
||||
void asyncResponsePostAsync(const Model::AsyncResponsePostRequest& request, const AsyncResponsePostAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
AsyncResponsePostOutcomeCallable asyncResponsePostCallable(const Model::AsyncResponsePostRequest& request) const;
|
||||
GetAlgorithmHistoryResultOutcome getAlgorithmHistoryResult(const Model::GetAlgorithmHistoryResultRequest &request)const;
|
||||
void getAlgorithmHistoryResultAsync(const Model::GetAlgorithmHistoryResultRequest& request, const GetAlgorithmHistoryResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetAlgorithmHistoryResultOutcomeCallable getAlgorithmHistoryResultCallable(const Model::GetAlgorithmHistoryResultRequest& request) const;
|
||||
GetServiceResultAsyncOutcome getServiceResultAsync(const Model::GetServiceResultAsyncRequest &request)const;
|
||||
void getServiceResultAsyncAsync(const Model::GetServiceResultAsyncRequest& request, const GetServiceResultAsyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetServiceResultAsyncOutcomeCallable getServiceResultAsyncCallable(const Model::GetServiceResultAsyncRequest& request) const;
|
||||
InvokeServiceOutcome invokeService(const Model::InvokeServiceRequest &request)const;
|
||||
void invokeServiceAsync(const Model::InvokeServiceRequest& request, const InvokeServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
InvokeServiceOutcomeCallable invokeServiceCallable(const Model::InvokeServiceRequest& request) const;
|
||||
InvokeServiceAsyncOutcome invokeServiceAsync(const Model::InvokeServiceAsyncRequest &request)const;
|
||||
void invokeServiceAsyncAsync(const Model::InvokeServiceAsyncRequest& request, const InvokeServiceAsyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
InvokeServiceAsyncOutcomeCallable invokeServiceAsyncCallable(const Model::InvokeServiceAsyncRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_INDUSTRY_BRAINCLIENT_H_
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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_INDUSTRY_BRAIN_INDUSTRY_BRAINEXPORT_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_INDUSTRY_BRAINEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_INDUSTRY_BRAIN_LIBRARY)
|
||||
# define ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_INDUSTRY_BRAINEXPORT_H_
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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_INDUSTRY_BRAIN_MODEL_ASYNCRESPONSEPOSTREQUEST_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_ASYNCRESPONSEPOSTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT AsyncResponsePostRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
AsyncResponsePostRequest();
|
||||
~AsyncResponsePostRequest();
|
||||
|
||||
std::string getData()const;
|
||||
void setData(const std::string& data);
|
||||
std::string getContext()const;
|
||||
void setContext(const std::string& context);
|
||||
float getProgress()const;
|
||||
void setProgress(float progress);
|
||||
std::string getMessage()const;
|
||||
void setMessage(const std::string& message);
|
||||
std::string getTaskId()const;
|
||||
void setTaskId(const std::string& taskId);
|
||||
std::string getStatus()const;
|
||||
void setStatus(const std::string& status);
|
||||
|
||||
private:
|
||||
std::string data_;
|
||||
std::string context_;
|
||||
float progress_;
|
||||
std::string message_;
|
||||
std::string taskId_;
|
||||
std::string status_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_ASYNCRESPONSEPOSTREQUEST_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_INDUSTRY_BRAIN_MODEL_ASYNCRESPONSEPOSTRESULT_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_ASYNCRESPONSEPOSTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT AsyncResponsePostResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
AsyncResponsePostResult();
|
||||
explicit AsyncResponsePostResult(const std::string &payload);
|
||||
~AsyncResponsePostResult();
|
||||
std::string getStatus()const;
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string status_;
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_ASYNCRESPONSEPOSTRESULT_H_
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* 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_INDUSTRY_BRAIN_MODEL_GETALGORITHMHISTORYRESULTREQUEST_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETALGORITHMHISTORYRESULTREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT GetAlgorithmHistoryResultRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetAlgorithmHistoryResultRequest();
|
||||
~GetAlgorithmHistoryResultRequest();
|
||||
|
||||
std::string getEndTime()const;
|
||||
void setEndTime(const std::string& endTime);
|
||||
std::string getStartTime()const;
|
||||
void setStartTime(const std::string& startTime);
|
||||
std::string getServiceId()const;
|
||||
void setServiceId(const std::string& serviceId);
|
||||
|
||||
private:
|
||||
std::string endTime_;
|
||||
std::string startTime_;
|
||||
std::string serviceId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETALGORITHMHISTORYRESULTREQUEST_H_
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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_INDUSTRY_BRAIN_MODEL_GETALGORITHMHISTORYRESULTRESULT_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETALGORITHMHISTORYRESULTRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT GetAlgorithmHistoryResultResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Region
|
||||
{
|
||||
std::string invokeTime;
|
||||
std::string input;
|
||||
std::string output;
|
||||
};
|
||||
|
||||
|
||||
GetAlgorithmHistoryResultResult();
|
||||
explicit GetAlgorithmHistoryResultResult(const std::string &payload);
|
||||
~GetAlgorithmHistoryResultResult();
|
||||
std::string getMessage()const;
|
||||
std::string getTraceId()const;
|
||||
std::vector<Region> getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string traceId_;
|
||||
std::vector<Region> data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETALGORITHMHISTORYRESULTRESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETSERVICERESULTASYNCREQUEST_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETSERVICERESULTASYNCREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT GetServiceResultAsyncRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
GetServiceResultAsyncRequest();
|
||||
~GetServiceResultAsyncRequest();
|
||||
|
||||
std::string getServiceId()const;
|
||||
void setServiceId(const std::string& serviceId);
|
||||
std::string getTaskId()const;
|
||||
void setTaskId(const std::string& taskId);
|
||||
|
||||
private:
|
||||
std::string serviceId_;
|
||||
std::string taskId_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETSERVICERESULTASYNCREQUEST_H_
|
||||
@@ -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_INDUSTRY_BRAIN_MODEL_GETSERVICERESULTASYNCRESULT_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETSERVICERESULTASYNCRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT GetServiceResultAsyncResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
GetServiceResultAsyncResult();
|
||||
explicit GetServiceResultAsyncResult(const std::string &payload);
|
||||
~GetServiceResultAsyncResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_GETSERVICERESULTASYNCRESULT_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_INDUSTRY_BRAIN_MODEL_INVOKESERVICEASYNCREQUEST_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICEASYNCREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT InvokeServiceAsyncRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
InvokeServiceAsyncRequest();
|
||||
~InvokeServiceAsyncRequest();
|
||||
|
||||
bool getIsShowInput()const;
|
||||
void setIsShowInput(bool isShowInput);
|
||||
std::string getServiceId()const;
|
||||
void setServiceId(const std::string& serviceId);
|
||||
std::string getParams()const;
|
||||
void setParams(const std::string& params);
|
||||
std::string getRequestData()const;
|
||||
void setRequestData(const std::string& requestData);
|
||||
|
||||
private:
|
||||
bool isShowInput_;
|
||||
std::string serviceId_;
|
||||
std::string params_;
|
||||
std::string requestData_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICEASYNCREQUEST_H_
|
||||
@@ -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_INDUSTRY_BRAIN_MODEL_INVOKESERVICEASYNCRESULT_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICEASYNCRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT InvokeServiceAsyncResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
InvokeServiceAsyncResult();
|
||||
explicit InvokeServiceAsyncResult(const std::string &payload);
|
||||
~InvokeServiceAsyncResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICEASYNCRESULT_H_
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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_INDUSTRY_BRAIN_MODEL_INVOKESERVICEREQUEST_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT InvokeServiceRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
InvokeServiceRequest();
|
||||
~InvokeServiceRequest();
|
||||
|
||||
std::string getRequestParams()const;
|
||||
void setRequestParams(const std::string& requestParams);
|
||||
bool getShowBizInfo()const;
|
||||
void setShowBizInfo(bool showBizInfo);
|
||||
bool getForceInvokeConfiguration()const;
|
||||
void setForceInvokeConfiguration(bool forceInvokeConfiguration);
|
||||
std::string getContext()const;
|
||||
void setContext(const std::string& context);
|
||||
std::string getServiceId()const;
|
||||
void setServiceId(const std::string& serviceId);
|
||||
std::string getRequestData()const;
|
||||
void setRequestData(const std::string& requestData);
|
||||
bool getShowParams()const;
|
||||
void setShowParams(bool showParams);
|
||||
|
||||
private:
|
||||
std::string requestParams_;
|
||||
bool showBizInfo_;
|
||||
bool forceInvokeConfiguration_;
|
||||
std::string context_;
|
||||
std::string serviceId_;
|
||||
std::string requestData_;
|
||||
bool showParams_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICEREQUEST_H_
|
||||
@@ -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_INDUSTRY_BRAIN_MODEL_INVOKESERVICERESULT_H_
|
||||
#define ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/industry-brain/Industry_brainExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Industry_brain
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_INDUSTRY_BRAIN_EXPORT InvokeServiceResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
InvokeServiceResult();
|
||||
explicit InvokeServiceResult(const std::string &payload);
|
||||
~InvokeServiceResult();
|
||||
std::string getMessage()const;
|
||||
std::string getData()const;
|
||||
std::string getCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string data_;
|
||||
std::string code_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_INDUSTRY_BRAIN_MODEL_INVOKESERVICERESULT_H_
|
||||
233
industry-brain/src/Industry-brainClient.cc
Normal file
233
industry-brain/src/Industry-brainClient.cc
Normal file
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* 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/industry-brain/Industry_brainClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Industry_brain;
|
||||
using namespace AlibabaCloud::Industry_brain::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "industry-brain";
|
||||
}
|
||||
|
||||
Industry_brainClient::Industry_brainClient(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, "");
|
||||
}
|
||||
|
||||
Industry_brainClient::Industry_brainClient(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, "");
|
||||
}
|
||||
|
||||
Industry_brainClient::Industry_brainClient(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, "");
|
||||
}
|
||||
|
||||
Industry_brainClient::~Industry_brainClient()
|
||||
{}
|
||||
|
||||
Industry_brainClient::AsyncResponsePostOutcome Industry_brainClient::asyncResponsePost(const AsyncResponsePostRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return AsyncResponsePostOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return AsyncResponsePostOutcome(AsyncResponsePostResult(outcome.result()));
|
||||
else
|
||||
return AsyncResponsePostOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Industry_brainClient::asyncResponsePostAsync(const AsyncResponsePostRequest& request, const AsyncResponsePostAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, asyncResponsePost(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Industry_brainClient::AsyncResponsePostOutcomeCallable Industry_brainClient::asyncResponsePostCallable(const AsyncResponsePostRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<AsyncResponsePostOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->asyncResponsePost(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Industry_brainClient::GetAlgorithmHistoryResultOutcome Industry_brainClient::getAlgorithmHistoryResult(const GetAlgorithmHistoryResultRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetAlgorithmHistoryResultOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetAlgorithmHistoryResultOutcome(GetAlgorithmHistoryResultResult(outcome.result()));
|
||||
else
|
||||
return GetAlgorithmHistoryResultOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Industry_brainClient::getAlgorithmHistoryResultAsync(const GetAlgorithmHistoryResultRequest& request, const GetAlgorithmHistoryResultAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getAlgorithmHistoryResult(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Industry_brainClient::GetAlgorithmHistoryResultOutcomeCallable Industry_brainClient::getAlgorithmHistoryResultCallable(const GetAlgorithmHistoryResultRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetAlgorithmHistoryResultOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getAlgorithmHistoryResult(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Industry_brainClient::GetServiceResultAsyncOutcome Industry_brainClient::getServiceResultAsync(const GetServiceResultAsyncRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetServiceResultAsyncOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetServiceResultAsyncOutcome(GetServiceResultAsyncResult(outcome.result()));
|
||||
else
|
||||
return GetServiceResultAsyncOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Industry_brainClient::getServiceResultAsyncAsync(const GetServiceResultAsyncRequest& request, const GetServiceResultAsyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getServiceResultAsync(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Industry_brainClient::GetServiceResultAsyncOutcomeCallable Industry_brainClient::getServiceResultAsyncCallable(const GetServiceResultAsyncRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetServiceResultAsyncOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getServiceResultAsync(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Industry_brainClient::InvokeServiceOutcome Industry_brainClient::invokeService(const InvokeServiceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return InvokeServiceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return InvokeServiceOutcome(InvokeServiceResult(outcome.result()));
|
||||
else
|
||||
return InvokeServiceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Industry_brainClient::invokeServiceAsync(const InvokeServiceRequest& request, const InvokeServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, invokeService(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Industry_brainClient::InvokeServiceOutcomeCallable Industry_brainClient::invokeServiceCallable(const InvokeServiceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<InvokeServiceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->invokeService(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Industry_brainClient::InvokeServiceAsyncOutcome Industry_brainClient::invokeServiceAsync(const InvokeServiceAsyncRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return InvokeServiceAsyncOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return InvokeServiceAsyncOutcome(InvokeServiceAsyncResult(outcome.result()));
|
||||
else
|
||||
return InvokeServiceAsyncOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Industry_brainClient::invokeServiceAsyncAsync(const InvokeServiceAsyncRequest& request, const InvokeServiceAsyncAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, invokeServiceAsync(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Industry_brainClient::InvokeServiceAsyncOutcomeCallable Industry_brainClient::invokeServiceAsyncCallable(const InvokeServiceAsyncRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<InvokeServiceAsyncOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->invokeServiceAsync(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
95
industry-brain/src/model/AsyncResponsePostRequest.cc
Normal file
95
industry-brain/src/model/AsyncResponsePostRequest.cc
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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/industry-brain/model/AsyncResponsePostRequest.h>
|
||||
|
||||
using AlibabaCloud::Industry_brain::Model::AsyncResponsePostRequest;
|
||||
|
||||
AsyncResponsePostRequest::AsyncResponsePostRequest() :
|
||||
RpcServiceRequest("industry-brain", "2019-06-29", "AsyncResponsePost")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
AsyncResponsePostRequest::~AsyncResponsePostRequest()
|
||||
{}
|
||||
|
||||
std::string AsyncResponsePostRequest::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
void AsyncResponsePostRequest::setData(const std::string& data)
|
||||
{
|
||||
data_ = data;
|
||||
setParameter("Data", data);
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostRequest::getContext()const
|
||||
{
|
||||
return context_;
|
||||
}
|
||||
|
||||
void AsyncResponsePostRequest::setContext(const std::string& context)
|
||||
{
|
||||
context_ = context;
|
||||
setParameter("Context", context);
|
||||
}
|
||||
|
||||
float AsyncResponsePostRequest::getProgress()const
|
||||
{
|
||||
return progress_;
|
||||
}
|
||||
|
||||
void AsyncResponsePostRequest::setProgress(float progress)
|
||||
{
|
||||
progress_ = progress;
|
||||
setParameter("Progress", std::to_string(progress));
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostRequest::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
void AsyncResponsePostRequest::setMessage(const std::string& message)
|
||||
{
|
||||
message_ = message;
|
||||
setParameter("Message", message);
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostRequest::getTaskId()const
|
||||
{
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void AsyncResponsePostRequest::setTaskId(const std::string& taskId)
|
||||
{
|
||||
taskId_ = taskId;
|
||||
setParameter("TaskId", taskId);
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostRequest::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
void AsyncResponsePostRequest::setStatus(const std::string& status)
|
||||
{
|
||||
status_ = status;
|
||||
setParameter("Status", status);
|
||||
}
|
||||
|
||||
72
industry-brain/src/model/AsyncResponsePostResult.cc
Normal file
72
industry-brain/src/model/AsyncResponsePostResult.cc
Normal 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/industry-brain/model/AsyncResponsePostResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Industry_brain;
|
||||
using namespace AlibabaCloud::Industry_brain::Model;
|
||||
|
||||
AsyncResponsePostResult::AsyncResponsePostResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
AsyncResponsePostResult::AsyncResponsePostResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
AsyncResponsePostResult::~AsyncResponsePostResult()
|
||||
{}
|
||||
|
||||
void AsyncResponsePostResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
if(!value["Status"].isNull())
|
||||
status_ = value["Status"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostResult::getStatus()const
|
||||
{
|
||||
return status_;
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string AsyncResponsePostResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
62
industry-brain/src/model/GetAlgorithmHistoryResultRequest.cc
Normal file
62
industry-brain/src/model/GetAlgorithmHistoryResultRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* 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/industry-brain/model/GetAlgorithmHistoryResultRequest.h>
|
||||
|
||||
using AlibabaCloud::Industry_brain::Model::GetAlgorithmHistoryResultRequest;
|
||||
|
||||
GetAlgorithmHistoryResultRequest::GetAlgorithmHistoryResultRequest() :
|
||||
RpcServiceRequest("industry-brain", "2019-06-29", "GetAlgorithmHistoryResult")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Get);
|
||||
}
|
||||
|
||||
GetAlgorithmHistoryResultRequest::~GetAlgorithmHistoryResultRequest()
|
||||
{}
|
||||
|
||||
std::string GetAlgorithmHistoryResultRequest::getEndTime()const
|
||||
{
|
||||
return endTime_;
|
||||
}
|
||||
|
||||
void GetAlgorithmHistoryResultRequest::setEndTime(const std::string& endTime)
|
||||
{
|
||||
endTime_ = endTime;
|
||||
setParameter("EndTime", endTime);
|
||||
}
|
||||
|
||||
std::string GetAlgorithmHistoryResultRequest::getStartTime()const
|
||||
{
|
||||
return startTime_;
|
||||
}
|
||||
|
||||
void GetAlgorithmHistoryResultRequest::setStartTime(const std::string& startTime)
|
||||
{
|
||||
startTime_ = startTime;
|
||||
setParameter("StartTime", startTime);
|
||||
}
|
||||
|
||||
std::string GetAlgorithmHistoryResultRequest::getServiceId()const
|
||||
{
|
||||
return serviceId_;
|
||||
}
|
||||
|
||||
void GetAlgorithmHistoryResultRequest::setServiceId(const std::string& serviceId)
|
||||
{
|
||||
serviceId_ = serviceId;
|
||||
setParameter("ServiceId", serviceId);
|
||||
}
|
||||
|
||||
82
industry-brain/src/model/GetAlgorithmHistoryResultResult.cc
Normal file
82
industry-brain/src/model/GetAlgorithmHistoryResultResult.cc
Normal file
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* 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/industry-brain/model/GetAlgorithmHistoryResultResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Industry_brain;
|
||||
using namespace AlibabaCloud::Industry_brain::Model;
|
||||
|
||||
GetAlgorithmHistoryResultResult::GetAlgorithmHistoryResultResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetAlgorithmHistoryResultResult::GetAlgorithmHistoryResultResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetAlgorithmHistoryResultResult::~GetAlgorithmHistoryResultResult()
|
||||
{}
|
||||
|
||||
void GetAlgorithmHistoryResultResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto allDataNode = value["Data"]["Region"];
|
||||
for (auto valueDataRegion : allDataNode)
|
||||
{
|
||||
Region dataObject;
|
||||
if(!valueDataRegion["Output"].isNull())
|
||||
dataObject.output = valueDataRegion["Output"].asString();
|
||||
if(!valueDataRegion["Input"].isNull())
|
||||
dataObject.input = valueDataRegion["Input"].asString();
|
||||
if(!valueDataRegion["InvokeTime"].isNull())
|
||||
dataObject.invokeTime = valueDataRegion["InvokeTime"].asString();
|
||||
data_.push_back(dataObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
if(!value["TraceId"].isNull())
|
||||
traceId_ = value["TraceId"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetAlgorithmHistoryResultResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string GetAlgorithmHistoryResultResult::getTraceId()const
|
||||
{
|
||||
return traceId_;
|
||||
}
|
||||
|
||||
std::vector<GetAlgorithmHistoryResultResult::Region> GetAlgorithmHistoryResultResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetAlgorithmHistoryResultResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
51
industry-brain/src/model/GetServiceResultAsyncRequest.cc
Normal file
51
industry-brain/src/model/GetServiceResultAsyncRequest.cc
Normal 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/industry-brain/model/GetServiceResultAsyncRequest.h>
|
||||
|
||||
using AlibabaCloud::Industry_brain::Model::GetServiceResultAsyncRequest;
|
||||
|
||||
GetServiceResultAsyncRequest::GetServiceResultAsyncRequest() :
|
||||
RpcServiceRequest("industry-brain", "2019-06-29", "GetServiceResultAsync")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetServiceResultAsyncRequest::~GetServiceResultAsyncRequest()
|
||||
{}
|
||||
|
||||
std::string GetServiceResultAsyncRequest::getServiceId()const
|
||||
{
|
||||
return serviceId_;
|
||||
}
|
||||
|
||||
void GetServiceResultAsyncRequest::setServiceId(const std::string& serviceId)
|
||||
{
|
||||
serviceId_ = serviceId;
|
||||
setParameter("ServiceId", serviceId);
|
||||
}
|
||||
|
||||
std::string GetServiceResultAsyncRequest::getTaskId()const
|
||||
{
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void GetServiceResultAsyncRequest::setTaskId(const std::string& taskId)
|
||||
{
|
||||
taskId_ = taskId;
|
||||
setParameter("TaskId", taskId);
|
||||
}
|
||||
|
||||
65
industry-brain/src/model/GetServiceResultAsyncResult.cc
Normal file
65
industry-brain/src/model/GetServiceResultAsyncResult.cc
Normal 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/industry-brain/model/GetServiceResultAsyncResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Industry_brain;
|
||||
using namespace AlibabaCloud::Industry_brain::Model;
|
||||
|
||||
GetServiceResultAsyncResult::GetServiceResultAsyncResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetServiceResultAsyncResult::GetServiceResultAsyncResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetServiceResultAsyncResult::~GetServiceResultAsyncResult()
|
||||
{}
|
||||
|
||||
void GetServiceResultAsyncResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetServiceResultAsyncResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string GetServiceResultAsyncResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetServiceResultAsyncResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
73
industry-brain/src/model/InvokeServiceAsyncRequest.cc
Normal file
73
industry-brain/src/model/InvokeServiceAsyncRequest.cc
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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/industry-brain/model/InvokeServiceAsyncRequest.h>
|
||||
|
||||
using AlibabaCloud::Industry_brain::Model::InvokeServiceAsyncRequest;
|
||||
|
||||
InvokeServiceAsyncRequest::InvokeServiceAsyncRequest() :
|
||||
RpcServiceRequest("industry-brain", "2019-06-29", "InvokeServiceAsync")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
InvokeServiceAsyncRequest::~InvokeServiceAsyncRequest()
|
||||
{}
|
||||
|
||||
bool InvokeServiceAsyncRequest::getIsShowInput()const
|
||||
{
|
||||
return isShowInput_;
|
||||
}
|
||||
|
||||
void InvokeServiceAsyncRequest::setIsShowInput(bool isShowInput)
|
||||
{
|
||||
isShowInput_ = isShowInput;
|
||||
setParameter("IsShowInput", isShowInput ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string InvokeServiceAsyncRequest::getServiceId()const
|
||||
{
|
||||
return serviceId_;
|
||||
}
|
||||
|
||||
void InvokeServiceAsyncRequest::setServiceId(const std::string& serviceId)
|
||||
{
|
||||
serviceId_ = serviceId;
|
||||
setParameter("ServiceId", serviceId);
|
||||
}
|
||||
|
||||
std::string InvokeServiceAsyncRequest::getParams()const
|
||||
{
|
||||
return params_;
|
||||
}
|
||||
|
||||
void InvokeServiceAsyncRequest::setParams(const std::string& params)
|
||||
{
|
||||
params_ = params;
|
||||
setParameter("Params", params);
|
||||
}
|
||||
|
||||
std::string InvokeServiceAsyncRequest::getRequestData()const
|
||||
{
|
||||
return requestData_;
|
||||
}
|
||||
|
||||
void InvokeServiceAsyncRequest::setRequestData(const std::string& requestData)
|
||||
{
|
||||
requestData_ = requestData;
|
||||
setParameter("RequestData", requestData);
|
||||
}
|
||||
|
||||
65
industry-brain/src/model/InvokeServiceAsyncResult.cc
Normal file
65
industry-brain/src/model/InvokeServiceAsyncResult.cc
Normal 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/industry-brain/model/InvokeServiceAsyncResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Industry_brain;
|
||||
using namespace AlibabaCloud::Industry_brain::Model;
|
||||
|
||||
InvokeServiceAsyncResult::InvokeServiceAsyncResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
InvokeServiceAsyncResult::InvokeServiceAsyncResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
InvokeServiceAsyncResult::~InvokeServiceAsyncResult()
|
||||
{}
|
||||
|
||||
void InvokeServiceAsyncResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string InvokeServiceAsyncResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string InvokeServiceAsyncResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string InvokeServiceAsyncResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
106
industry-brain/src/model/InvokeServiceRequest.cc
Normal file
106
industry-brain/src/model/InvokeServiceRequest.cc
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 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/industry-brain/model/InvokeServiceRequest.h>
|
||||
|
||||
using AlibabaCloud::Industry_brain::Model::InvokeServiceRequest;
|
||||
|
||||
InvokeServiceRequest::InvokeServiceRequest() :
|
||||
RpcServiceRequest("industry-brain", "2019-06-29", "InvokeService")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
InvokeServiceRequest::~InvokeServiceRequest()
|
||||
{}
|
||||
|
||||
std::string InvokeServiceRequest::getRequestParams()const
|
||||
{
|
||||
return requestParams_;
|
||||
}
|
||||
|
||||
void InvokeServiceRequest::setRequestParams(const std::string& requestParams)
|
||||
{
|
||||
requestParams_ = requestParams;
|
||||
setParameter("RequestParams", requestParams);
|
||||
}
|
||||
|
||||
bool InvokeServiceRequest::getShowBizInfo()const
|
||||
{
|
||||
return showBizInfo_;
|
||||
}
|
||||
|
||||
void InvokeServiceRequest::setShowBizInfo(bool showBizInfo)
|
||||
{
|
||||
showBizInfo_ = showBizInfo;
|
||||
setParameter("ShowBizInfo", showBizInfo ? "true" : "false");
|
||||
}
|
||||
|
||||
bool InvokeServiceRequest::getForceInvokeConfiguration()const
|
||||
{
|
||||
return forceInvokeConfiguration_;
|
||||
}
|
||||
|
||||
void InvokeServiceRequest::setForceInvokeConfiguration(bool forceInvokeConfiguration)
|
||||
{
|
||||
forceInvokeConfiguration_ = forceInvokeConfiguration;
|
||||
setParameter("ForceInvokeConfiguration", forceInvokeConfiguration ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string InvokeServiceRequest::getContext()const
|
||||
{
|
||||
return context_;
|
||||
}
|
||||
|
||||
void InvokeServiceRequest::setContext(const std::string& context)
|
||||
{
|
||||
context_ = context;
|
||||
setParameter("Context", context);
|
||||
}
|
||||
|
||||
std::string InvokeServiceRequest::getServiceId()const
|
||||
{
|
||||
return serviceId_;
|
||||
}
|
||||
|
||||
void InvokeServiceRequest::setServiceId(const std::string& serviceId)
|
||||
{
|
||||
serviceId_ = serviceId;
|
||||
setParameter("ServiceId", serviceId);
|
||||
}
|
||||
|
||||
std::string InvokeServiceRequest::getRequestData()const
|
||||
{
|
||||
return requestData_;
|
||||
}
|
||||
|
||||
void InvokeServiceRequest::setRequestData(const std::string& requestData)
|
||||
{
|
||||
requestData_ = requestData;
|
||||
setParameter("RequestData", requestData);
|
||||
}
|
||||
|
||||
bool InvokeServiceRequest::getShowParams()const
|
||||
{
|
||||
return showParams_;
|
||||
}
|
||||
|
||||
void InvokeServiceRequest::setShowParams(bool showParams)
|
||||
{
|
||||
showParams_ = showParams;
|
||||
setParameter("ShowParams", showParams ? "true" : "false");
|
||||
}
|
||||
|
||||
65
industry-brain/src/model/InvokeServiceResult.cc
Normal file
65
industry-brain/src/model/InvokeServiceResult.cc
Normal 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/industry-brain/model/InvokeServiceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Industry_brain;
|
||||
using namespace AlibabaCloud::Industry_brain::Model;
|
||||
|
||||
InvokeServiceResult::InvokeServiceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
InvokeServiceResult::InvokeServiceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
InvokeServiceResult::~InvokeServiceResult()
|
||||
{}
|
||||
|
||||
void InvokeServiceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Data"].isNull())
|
||||
data_ = value["Data"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string InvokeServiceResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string InvokeServiceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string InvokeServiceResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user