Compare commits
108 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e2ee6d530 | ||
|
|
51d167c03c | ||
|
|
f6470e6c02 | ||
|
|
d77681a132 | ||
|
|
7ceaff6c6e | ||
|
|
5048e01469 | ||
|
|
322f1ef667 | ||
|
|
b52edc6252 | ||
|
|
ac468a852e | ||
|
|
6abf1431b6 | ||
|
|
f22a078c0d | ||
|
|
5b357e5604 | ||
|
|
479a50df98 | ||
|
|
f341a65b45 | ||
|
|
0b153cfa56 | ||
|
|
9d5401c5cc | ||
|
|
1d3414a920 | ||
|
|
c0a0891ea7 | ||
|
|
8173f354c3 | ||
|
|
3b5f67fc09 | ||
|
|
9d1d86828b | ||
|
|
5b7a4727cb | ||
|
|
53db98b044 | ||
|
|
a74b01935d | ||
|
|
0b56244443 | ||
|
|
d8723973a4 | ||
|
|
8241d996ce | ||
|
|
ec161f0408 | ||
|
|
70bcdee246 | ||
|
|
6a7e1f141c | ||
|
|
ecf6c5f448 | ||
|
|
eef41337b0 | ||
|
|
83325f3e37 | ||
|
|
808e4da670 | ||
|
|
070025342e | ||
|
|
8e06520db5 | ||
|
|
9a6e36ba1b | ||
|
|
44d329a7b7 | ||
|
|
fb86207f1d | ||
|
|
377eb9e470 | ||
|
|
69374307d5 | ||
|
|
7809012e2d | ||
|
|
88f17da9be | ||
|
|
ee32114ccc | ||
|
|
692a2a3429 | ||
|
|
2616afb389 | ||
|
|
d2887a4adc | ||
|
|
e7d1a04d88 | ||
|
|
164bc90823 | ||
|
|
bdba38a5ae | ||
|
|
75a566b4d3 | ||
|
|
1e67a571a1 | ||
|
|
fc5b3998fe | ||
|
|
23a2074f17 | ||
|
|
b4df698c3e | ||
|
|
9f1edb0b33 | ||
|
|
5bd1d921f4 | ||
|
|
c0c834e64a | ||
|
|
9b2557bf41 | ||
|
|
1f2e0e0b42 | ||
|
|
0b9b79f37b | ||
|
|
62ea99cdb2 | ||
|
|
54be46c456 | ||
|
|
8d6c81401f | ||
|
|
72138b276a | ||
|
|
53d26e9957 | ||
|
|
7f21cf83b9 | ||
|
|
cf5863b104 | ||
|
|
28503fa2e5 | ||
|
|
a71e6dd1ae | ||
|
|
af9bc95b0b | ||
|
|
4208be77a5 | ||
|
|
338fe94f31 | ||
|
|
fb513278fe | ||
|
|
ec9cd15b58 | ||
|
|
1954195d9c | ||
|
|
ffd0c138d3 | ||
|
|
40a7995d11 | ||
|
|
2ebf998ace | ||
|
|
444397191f | ||
|
|
a09160460b | ||
|
|
cd9e24cdd0 | ||
|
|
6830235852 | ||
|
|
bc2d245597 | ||
|
|
168c4f1cf1 | ||
|
|
948b05b62e | ||
|
|
3e5235c2ca | ||
|
|
6deaa997fb | ||
|
|
dbe02e376e | ||
|
|
0c2f5f41c4 | ||
|
|
1d1099683e | ||
|
|
48362f9159 | ||
|
|
574a5e964d | ||
|
|
04ef9028c2 | ||
|
|
ff5406a429 | ||
|
|
18687c978c | ||
|
|
5416b57b75 | ||
|
|
43d3080407 | ||
|
|
fe745e81c4 | ||
|
|
e05ba433d0 | ||
|
|
19026e1ca1 | ||
|
|
4d0d423351 | ||
|
|
5d774bf4d2 | ||
|
|
5c863a0c43 | ||
|
|
d5a286f460 | ||
|
|
055e9fa24d | ||
|
|
779a64ae99 | ||
|
|
689a48e2ef |
@@ -11,9 +11,9 @@
|
||||
<a href="https://codecov.io/gh/aliyun/aliyun-openapi-cpp-sdk"><img src="https://codecov.io/gh/aliyun/aliyun-openapi-cpp-sdk/branch/master/graph/badge.svg" alt="codecov"></a>
|
||||
</p>
|
||||
|
||||
Alibaba Cloud SDK for C++ 让您不用复杂编程即可访问云服务器、负载均衡、云监控等阿里云服务。这里向您介绍如何获取 Alibaba Cloud SDK for C++ 并开始调用。
|
||||
阿里云 V1.0 SDK 即将进入基础安全维护阶段,不再建议使用,建议使用 V2.0 SDK。
|
||||
|
||||
如果您在使用的过程中遇到任何问题,欢迎前往[阿里云SDK问答社区](https://yq.aliyun.com/tags/type_ask-tagid_23350)提问,提问前请阅读[提问引导](https://help.aliyun.com/document_detail/93957.html)。亦可在当前 GitHub [提交 Issues](https://github.com/aliyun/aliyun-openapi-cpp-sdk/issues/new)。
|
||||
如果您在使用的过程中遇到任何问题,可在当前 GitHub [提交 Issues](https://github.com/aliyun/aliyun-openapi-cpp-sdk/issues/new)。
|
||||
|
||||
## 使用诊断
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@ English | [简体中文](./README-CN.md)
|
||||
<a href="https://codecov.io/gh/aliyun/aliyun-openapi-cpp-sdk"><img src="https://codecov.io/gh/aliyun/aliyun-openapi-cpp-sdk/branch/master/graph/badge.svg" alt="codecov"></a>
|
||||
</p>
|
||||
|
||||
Alibaba Cloud SDK for C++ allows you to access Alibaba Cloud services such as Elastic Compute Service (ECS), Server Load Balancer (SLB), and CloudMonitor. You can access Alibaba Cloud services without the need to handle API related tasks, such as signing and constructing your requests.
|
||||
|
||||
This document introduces how to obtain and call this SDK.
|
||||
The Alibaba Cloud V1.0 SDK will soon enter the Basic Security Maintenance phase and is no longer recommended for use. It is suggested to use the V2.0 SDK instead.
|
||||
|
||||
If you have any problem while using Alibaba Cloud SDK for C++, please submit an [issue](https://github.com/aliyun/aliyun-openapi-cpp-sdk/issues/new).
|
||||
|
||||
|
||||
102
aimath/CMakeLists.txt
Normal file
102
aimath/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(aimath_public_header
|
||||
include/alibabacloud/aimath/AIMathClient.h
|
||||
include/alibabacloud/aimath/AIMathExport.h )
|
||||
|
||||
set(aimath_public_header_model
|
||||
include/alibabacloud/aimath/model/GenAnalysisRequest.h
|
||||
include/alibabacloud/aimath/model/GenAnalysisResult.h
|
||||
include/alibabacloud/aimath/model/GenStepRequest.h
|
||||
include/alibabacloud/aimath/model/GenStepResult.h
|
||||
include/alibabacloud/aimath/model/GlobalConfirmRequest.h
|
||||
include/alibabacloud/aimath/model/GlobalConfirmResult.h
|
||||
include/alibabacloud/aimath/model/UpdateAnalysisRequest.h
|
||||
include/alibabacloud/aimath/model/UpdateAnalysisResult.h
|
||||
include/alibabacloud/aimath/model/UpdateStepRequest.h
|
||||
include/alibabacloud/aimath/model/UpdateStepResult.h )
|
||||
|
||||
set(aimath_src
|
||||
src/AIMathClient.cc
|
||||
src/model/GenAnalysisRequest.cc
|
||||
src/model/GenAnalysisResult.cc
|
||||
src/model/GenStepRequest.cc
|
||||
src/model/GenStepResult.cc
|
||||
src/model/GlobalConfirmRequest.cc
|
||||
src/model/GlobalConfirmResult.cc
|
||||
src/model/UpdateAnalysisRequest.cc
|
||||
src/model/UpdateAnalysisResult.cc
|
||||
src/model/UpdateStepRequest.cc
|
||||
src/model/UpdateStepResult.cc )
|
||||
|
||||
add_library(aimath ${LIB_TYPE}
|
||||
${aimath_public_header}
|
||||
${aimath_public_header_model}
|
||||
${aimath_src})
|
||||
|
||||
set_target_properties(aimath
|
||||
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}aimath
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(aimath
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_AIMATH_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(aimath
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(aimath
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(aimath
|
||||
jsoncpp)
|
||||
target_include_directories(aimath
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(aimath
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(aimath
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(aimath
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(aimath
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${aimath_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aimath)
|
||||
install(FILES ${aimath_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aimath/model)
|
||||
install(TARGETS aimath
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
86
aimath/include/alibabacloud/aimath/AIMathClient.h
Normal file
86
aimath/include/alibabacloud/aimath/AIMathClient.h
Normal file
@@ -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_AIMATH_AIMATHCLIENT_H_
|
||||
#define ALIBABACLOUD_AIMATH_AIMATHCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "AIMathExport.h"
|
||||
#include "model/GenAnalysisRequest.h"
|
||||
#include "model/GenAnalysisResult.h"
|
||||
#include "model/GenStepRequest.h"
|
||||
#include "model/GenStepResult.h"
|
||||
#include "model/GlobalConfirmRequest.h"
|
||||
#include "model/GlobalConfirmResult.h"
|
||||
#include "model/UpdateAnalysisRequest.h"
|
||||
#include "model/UpdateAnalysisResult.h"
|
||||
#include "model/UpdateStepRequest.h"
|
||||
#include "model/UpdateStepResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIMath
|
||||
{
|
||||
class ALIBABACLOUD_AIMATH_EXPORT AIMathClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::GenAnalysisResult> GenAnalysisOutcome;
|
||||
typedef std::future<GenAnalysisOutcome> GenAnalysisOutcomeCallable;
|
||||
typedef std::function<void(const AIMathClient*, const Model::GenAnalysisRequest&, const GenAnalysisOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenAnalysisAsyncHandler;
|
||||
typedef Outcome<Error, Model::GenStepResult> GenStepOutcome;
|
||||
typedef std::future<GenStepOutcome> GenStepOutcomeCallable;
|
||||
typedef std::function<void(const AIMathClient*, const Model::GenStepRequest&, const GenStepOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GenStepAsyncHandler;
|
||||
typedef Outcome<Error, Model::GlobalConfirmResult> GlobalConfirmOutcome;
|
||||
typedef std::future<GlobalConfirmOutcome> GlobalConfirmOutcomeCallable;
|
||||
typedef std::function<void(const AIMathClient*, const Model::GlobalConfirmRequest&, const GlobalConfirmOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GlobalConfirmAsyncHandler;
|
||||
typedef Outcome<Error, Model::UpdateAnalysisResult> UpdateAnalysisOutcome;
|
||||
typedef std::future<UpdateAnalysisOutcome> UpdateAnalysisOutcomeCallable;
|
||||
typedef std::function<void(const AIMathClient*, const Model::UpdateAnalysisRequest&, const UpdateAnalysisOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpdateAnalysisAsyncHandler;
|
||||
typedef Outcome<Error, Model::UpdateStepResult> UpdateStepOutcome;
|
||||
typedef std::future<UpdateStepOutcome> UpdateStepOutcomeCallable;
|
||||
typedef std::function<void(const AIMathClient*, const Model::UpdateStepRequest&, const UpdateStepOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> UpdateStepAsyncHandler;
|
||||
|
||||
AIMathClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
AIMathClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
AIMathClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~AIMathClient();
|
||||
GenAnalysisOutcome genAnalysis(const Model::GenAnalysisRequest &request)const;
|
||||
void genAnalysisAsync(const Model::GenAnalysisRequest& request, const GenAnalysisAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GenAnalysisOutcomeCallable genAnalysisCallable(const Model::GenAnalysisRequest& request) const;
|
||||
GenStepOutcome genStep(const Model::GenStepRequest &request)const;
|
||||
void genStepAsync(const Model::GenStepRequest& request, const GenStepAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GenStepOutcomeCallable genStepCallable(const Model::GenStepRequest& request) const;
|
||||
GlobalConfirmOutcome globalConfirm(const Model::GlobalConfirmRequest &request)const;
|
||||
void globalConfirmAsync(const Model::GlobalConfirmRequest& request, const GlobalConfirmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GlobalConfirmOutcomeCallable globalConfirmCallable(const Model::GlobalConfirmRequest& request) const;
|
||||
UpdateAnalysisOutcome updateAnalysis(const Model::UpdateAnalysisRequest &request)const;
|
||||
void updateAnalysisAsync(const Model::UpdateAnalysisRequest& request, const UpdateAnalysisAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
UpdateAnalysisOutcomeCallable updateAnalysisCallable(const Model::UpdateAnalysisRequest& request) const;
|
||||
UpdateStepOutcome updateStep(const Model::UpdateStepRequest &request)const;
|
||||
void updateStepAsync(const Model::UpdateStepRequest& request, const UpdateStepAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
UpdateStepOutcomeCallable updateStepCallable(const Model::UpdateStepRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_AIMATH_AIMATHCLIENT_H_
|
||||
32
aimath/include/alibabacloud/aimath/AIMathExport.h
Normal file
32
aimath/include/alibabacloud/aimath/AIMathExport.h
Normal file
@@ -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_AIMATH_AIMATHEXPORT_H_
|
||||
#define ALIBABACLOUD_AIMATH_AIMATHEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_AIMATH_LIBRARY)
|
||||
# define ALIBABACLOUD_AIMATH_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_AIMATH_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_AIMATH_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_AIMATH_AIMATHEXPORT_H_
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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_AIMATH_MODEL_GENANALYSISREQUEST_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_GENANALYSISREQUEST_H_
|
||||
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AIMath {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_AIMATH_EXPORT GenAnalysisRequest : public RpcServiceRequest {
|
||||
public:
|
||||
GenAnalysisRequest();
|
||||
~GenAnalysisRequest();
|
||||
std::string getExerciseContent() const;
|
||||
void setExerciseContent(const std::string &exerciseContent);
|
||||
|
||||
private:
|
||||
std::string exerciseContent_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AIMath
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_GENANALYSISREQUEST_H_
|
||||
57
aimath/include/alibabacloud/aimath/model/GenAnalysisResult.h
Normal file
57
aimath/include/alibabacloud/aimath/model/GenAnalysisResult.h
Normal file
@@ -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_AIMATH_MODEL_GENANALYSISRESULT_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_GENANALYSISRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIMath
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AIMATH_EXPORT GenAnalysisResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
GenAnalysisResult();
|
||||
explicit GenAnalysisResult(const std::string &payload);
|
||||
~GenAnalysisResult();
|
||||
std::string getEventType()const;
|
||||
std::string getErrMsg()const;
|
||||
std::string getContent()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string eventType_;
|
||||
std::string errMsg_;
|
||||
std::string content_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_GENANALYSISRESULT_H_
|
||||
42
aimath/include/alibabacloud/aimath/model/GenStepRequest.h
Normal file
42
aimath/include/alibabacloud/aimath/model/GenStepRequest.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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_AIMATH_MODEL_GENSTEPREQUEST_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_GENSTEPREQUEST_H_
|
||||
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AIMath {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_AIMATH_EXPORT GenStepRequest : public RpcServiceRequest {
|
||||
public:
|
||||
GenStepRequest();
|
||||
~GenStepRequest();
|
||||
std::string getExerciseCode() const;
|
||||
void setExerciseCode(const std::string &exerciseCode);
|
||||
|
||||
private:
|
||||
std::string exerciseCode_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AIMath
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_GENSTEPREQUEST_H_
|
||||
57
aimath/include/alibabacloud/aimath/model/GenStepResult.h
Normal file
57
aimath/include/alibabacloud/aimath/model/GenStepResult.h
Normal file
@@ -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_AIMATH_MODEL_GENSTEPRESULT_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_GENSTEPRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIMath
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AIMATH_EXPORT GenStepResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
GenStepResult();
|
||||
explicit GenStepResult(const std::string &payload);
|
||||
~GenStepResult();
|
||||
std::string getEventType()const;
|
||||
std::string getErrMsg()const;
|
||||
std::string getContent()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string eventType_;
|
||||
std::string errMsg_;
|
||||
std::string content_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_GENSTEPRESULT_H_
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_AIMATH_MODEL_GLOBALCONFIRMREQUEST_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_GLOBALCONFIRMREQUEST_H_
|
||||
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AIMath {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_AIMATH_EXPORT GlobalConfirmRequest : public RpcServiceRequest {
|
||||
public:
|
||||
GlobalConfirmRequest();
|
||||
~GlobalConfirmRequest();
|
||||
std::string getTag() const;
|
||||
void setTag(const std::string &tag);
|
||||
std::string getExerciseCode() const;
|
||||
void setExerciseCode(const std::string &exerciseCode);
|
||||
|
||||
private:
|
||||
std::string tag_;
|
||||
std::string exerciseCode_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AIMath
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_GLOBALCONFIRMREQUEST_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_AIMATH_MODEL_GLOBALCONFIRMRESULT_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_GLOBALCONFIRMRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIMath
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AIMATH_EXPORT GlobalConfirmResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
GlobalConfirmResult();
|
||||
explicit GlobalConfirmResult(const std::string &payload);
|
||||
~GlobalConfirmResult();
|
||||
std::string getErrMsg()const;
|
||||
bool getSuccess()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string errMsg_;
|
||||
bool success_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_GLOBALCONFIRMRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_AIMATH_MODEL_UPDATEANALYSISREQUEST_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_UPDATEANALYSISREQUEST_H_
|
||||
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AIMath {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_AIMATH_EXPORT UpdateAnalysisRequest : public RpcServiceRequest {
|
||||
public:
|
||||
UpdateAnalysisRequest();
|
||||
~UpdateAnalysisRequest();
|
||||
std::string getContent() const;
|
||||
void setContent(const std::string &content);
|
||||
std::string getContentCode() const;
|
||||
void setContentCode(const std::string &contentCode);
|
||||
std::string getExerciseCode() const;
|
||||
void setExerciseCode(const std::string &exerciseCode);
|
||||
|
||||
private:
|
||||
std::string content_;
|
||||
std::string contentCode_;
|
||||
std::string exerciseCode_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AIMath
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_UPDATEANALYSISREQUEST_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_AIMATH_MODEL_UPDATEANALYSISRESULT_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_UPDATEANALYSISRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIMath
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AIMATH_EXPORT UpdateAnalysisResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
UpdateAnalysisResult();
|
||||
explicit UpdateAnalysisResult(const std::string &payload);
|
||||
~UpdateAnalysisResult();
|
||||
std::string getErrMsg()const;
|
||||
bool getSuccess()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string errMsg_;
|
||||
bool success_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_UPDATEANALYSISRESULT_H_
|
||||
48
aimath/include/alibabacloud/aimath/model/UpdateStepRequest.h
Normal file
48
aimath/include/alibabacloud/aimath/model/UpdateStepRequest.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_AIMATH_MODEL_UPDATESTEPREQUEST_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_UPDATESTEPREQUEST_H_
|
||||
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AIMath {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_AIMATH_EXPORT UpdateStepRequest : public RpcServiceRequest {
|
||||
public:
|
||||
UpdateStepRequest();
|
||||
~UpdateStepRequest();
|
||||
std::string getContent() const;
|
||||
void setContent(const std::string &content);
|
||||
std::string getContentCode() const;
|
||||
void setContentCode(const std::string &contentCode);
|
||||
std::string getExerciseCode() const;
|
||||
void setExerciseCode(const std::string &exerciseCode);
|
||||
|
||||
private:
|
||||
std::string content_;
|
||||
std::string contentCode_;
|
||||
std::string exerciseCode_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AIMath
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_UPDATESTEPREQUEST_H_
|
||||
55
aimath/include/alibabacloud/aimath/model/UpdateStepResult.h
Normal file
55
aimath/include/alibabacloud/aimath/model/UpdateStepResult.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_AIMATH_MODEL_UPDATESTEPRESULT_H_
|
||||
#define ALIBABACLOUD_AIMATH_MODEL_UPDATESTEPRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aimath/AIMathExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIMath
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AIMATH_EXPORT UpdateStepResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
UpdateStepResult();
|
||||
explicit UpdateStepResult(const std::string &payload);
|
||||
~UpdateStepResult();
|
||||
std::string getErrMsg()const;
|
||||
bool getSuccess()const;
|
||||
std::string getErrCode()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string errMsg_;
|
||||
bool success_;
|
||||
std::string errCode_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AIMATH_MODEL_UPDATESTEPRESULT_H_
|
||||
233
aimath/src/AIMathClient.cc
Normal file
233
aimath/src/AIMathClient.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/aimath/AIMathClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::AIMath;
|
||||
using namespace AlibabaCloud::AIMath::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "AIMath";
|
||||
}
|
||||
|
||||
AIMathClient::AIMathClient(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, "");
|
||||
}
|
||||
|
||||
AIMathClient::AIMathClient(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, "");
|
||||
}
|
||||
|
||||
AIMathClient::AIMathClient(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, "");
|
||||
}
|
||||
|
||||
AIMathClient::~AIMathClient()
|
||||
{}
|
||||
|
||||
AIMathClient::GenAnalysisOutcome AIMathClient::genAnalysis(const GenAnalysisRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GenAnalysisOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GenAnalysisOutcome(GenAnalysisResult(outcome.result()));
|
||||
else
|
||||
return GenAnalysisOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AIMathClient::genAnalysisAsync(const GenAnalysisRequest& request, const GenAnalysisAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, genAnalysis(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AIMathClient::GenAnalysisOutcomeCallable AIMathClient::genAnalysisCallable(const GenAnalysisRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GenAnalysisOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->genAnalysis(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AIMathClient::GenStepOutcome AIMathClient::genStep(const GenStepRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GenStepOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GenStepOutcome(GenStepResult(outcome.result()));
|
||||
else
|
||||
return GenStepOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AIMathClient::genStepAsync(const GenStepRequest& request, const GenStepAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, genStep(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AIMathClient::GenStepOutcomeCallable AIMathClient::genStepCallable(const GenStepRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GenStepOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->genStep(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AIMathClient::GlobalConfirmOutcome AIMathClient::globalConfirm(const GlobalConfirmRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GlobalConfirmOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GlobalConfirmOutcome(GlobalConfirmResult(outcome.result()));
|
||||
else
|
||||
return GlobalConfirmOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AIMathClient::globalConfirmAsync(const GlobalConfirmRequest& request, const GlobalConfirmAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, globalConfirm(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AIMathClient::GlobalConfirmOutcomeCallable AIMathClient::globalConfirmCallable(const GlobalConfirmRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GlobalConfirmOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->globalConfirm(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AIMathClient::UpdateAnalysisOutcome AIMathClient::updateAnalysis(const UpdateAnalysisRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdateAnalysisOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdateAnalysisOutcome(UpdateAnalysisResult(outcome.result()));
|
||||
else
|
||||
return UpdateAnalysisOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AIMathClient::updateAnalysisAsync(const UpdateAnalysisRequest& request, const UpdateAnalysisAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updateAnalysis(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AIMathClient::UpdateAnalysisOutcomeCallable AIMathClient::updateAnalysisCallable(const UpdateAnalysisRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdateAnalysisOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updateAnalysis(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AIMathClient::UpdateStepOutcome AIMathClient::updateStep(const UpdateStepRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return UpdateStepOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return UpdateStepOutcome(UpdateStepResult(outcome.result()));
|
||||
else
|
||||
return UpdateStepOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AIMathClient::updateStepAsync(const UpdateStepRequest& request, const UpdateStepAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, updateStep(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AIMathClient::UpdateStepOutcomeCallable AIMathClient::updateStepCallable(const UpdateStepRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<UpdateStepOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->updateStep(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
36
aimath/src/model/GenAnalysisRequest.cc
Normal file
36
aimath/src/model/GenAnalysisRequest.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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/aimath/model/GenAnalysisRequest.h>
|
||||
|
||||
using AlibabaCloud::AIMath::Model::GenAnalysisRequest;
|
||||
|
||||
GenAnalysisRequest::GenAnalysisRequest()
|
||||
: RpcServiceRequest("aimath", "2024-11-14", "GenAnalysis") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GenAnalysisRequest::~GenAnalysisRequest() {}
|
||||
|
||||
std::string GenAnalysisRequest::getExerciseContent() const {
|
||||
return exerciseContent_;
|
||||
}
|
||||
|
||||
void GenAnalysisRequest::setExerciseContent(const std::string &exerciseContent) {
|
||||
exerciseContent_ = exerciseContent;
|
||||
setBodyParameter(std::string("ExerciseContent"), exerciseContent);
|
||||
}
|
||||
|
||||
72
aimath/src/model/GenAnalysisResult.cc
Normal file
72
aimath/src/model/GenAnalysisResult.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/aimath/model/GenAnalysisResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AIMath;
|
||||
using namespace AlibabaCloud::AIMath::Model;
|
||||
|
||||
GenAnalysisResult::GenAnalysisResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GenAnalysisResult::GenAnalysisResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GenAnalysisResult::~GenAnalysisResult()
|
||||
{}
|
||||
|
||||
void GenAnalysisResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["EventType"].isNull())
|
||||
eventType_ = value["EventType"].asString();
|
||||
if(!value["Content"].isNull())
|
||||
content_ = value["Content"].asString();
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
if(!value["ErrMsg"].isNull())
|
||||
errMsg_ = value["ErrMsg"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GenAnalysisResult::getEventType()const
|
||||
{
|
||||
return eventType_;
|
||||
}
|
||||
|
||||
std::string GenAnalysisResult::getErrMsg()const
|
||||
{
|
||||
return errMsg_;
|
||||
}
|
||||
|
||||
std::string GenAnalysisResult::getContent()const
|
||||
{
|
||||
return content_;
|
||||
}
|
||||
|
||||
std::string GenAnalysisResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
36
aimath/src/model/GenStepRequest.cc
Normal file
36
aimath/src/model/GenStepRequest.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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/aimath/model/GenStepRequest.h>
|
||||
|
||||
using AlibabaCloud::AIMath::Model::GenStepRequest;
|
||||
|
||||
GenStepRequest::GenStepRequest()
|
||||
: RpcServiceRequest("aimath", "2024-11-14", "GenStep") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GenStepRequest::~GenStepRequest() {}
|
||||
|
||||
std::string GenStepRequest::getExerciseCode() const {
|
||||
return exerciseCode_;
|
||||
}
|
||||
|
||||
void GenStepRequest::setExerciseCode(const std::string &exerciseCode) {
|
||||
exerciseCode_ = exerciseCode;
|
||||
setBodyParameter(std::string("ExerciseCode"), exerciseCode);
|
||||
}
|
||||
|
||||
72
aimath/src/model/GenStepResult.cc
Normal file
72
aimath/src/model/GenStepResult.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/aimath/model/GenStepResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AIMath;
|
||||
using namespace AlibabaCloud::AIMath::Model;
|
||||
|
||||
GenStepResult::GenStepResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GenStepResult::GenStepResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GenStepResult::~GenStepResult()
|
||||
{}
|
||||
|
||||
void GenStepResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["EventType"].isNull())
|
||||
eventType_ = value["EventType"].asString();
|
||||
if(!value["Content"].isNull())
|
||||
content_ = value["Content"].asString();
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
if(!value["ErrMsg"].isNull())
|
||||
errMsg_ = value["ErrMsg"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GenStepResult::getEventType()const
|
||||
{
|
||||
return eventType_;
|
||||
}
|
||||
|
||||
std::string GenStepResult::getErrMsg()const
|
||||
{
|
||||
return errMsg_;
|
||||
}
|
||||
|
||||
std::string GenStepResult::getContent()const
|
||||
{
|
||||
return content_;
|
||||
}
|
||||
|
||||
std::string GenStepResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
45
aimath/src/model/GlobalConfirmRequest.cc
Normal file
45
aimath/src/model/GlobalConfirmRequest.cc
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aimath/model/GlobalConfirmRequest.h>
|
||||
|
||||
using AlibabaCloud::AIMath::Model::GlobalConfirmRequest;
|
||||
|
||||
GlobalConfirmRequest::GlobalConfirmRequest()
|
||||
: RpcServiceRequest("aimath", "2024-11-14", "GlobalConfirm") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GlobalConfirmRequest::~GlobalConfirmRequest() {}
|
||||
|
||||
std::string GlobalConfirmRequest::getTag() const {
|
||||
return tag_;
|
||||
}
|
||||
|
||||
void GlobalConfirmRequest::setTag(const std::string &tag) {
|
||||
tag_ = tag;
|
||||
setBodyParameter(std::string("Tag"), tag);
|
||||
}
|
||||
|
||||
std::string GlobalConfirmRequest::getExerciseCode() const {
|
||||
return exerciseCode_;
|
||||
}
|
||||
|
||||
void GlobalConfirmRequest::setExerciseCode(const std::string &exerciseCode) {
|
||||
exerciseCode_ = exerciseCode;
|
||||
setBodyParameter(std::string("ExerciseCode"), exerciseCode);
|
||||
}
|
||||
|
||||
65
aimath/src/model/GlobalConfirmResult.cc
Normal file
65
aimath/src/model/GlobalConfirmResult.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/aimath/model/GlobalConfirmResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AIMath;
|
||||
using namespace AlibabaCloud::AIMath::Model;
|
||||
|
||||
GlobalConfirmResult::GlobalConfirmResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GlobalConfirmResult::GlobalConfirmResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GlobalConfirmResult::~GlobalConfirmResult()
|
||||
{}
|
||||
|
||||
void GlobalConfirmResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
if(!value["ErrMsg"].isNull())
|
||||
errMsg_ = value["ErrMsg"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GlobalConfirmResult::getErrMsg()const
|
||||
{
|
||||
return errMsg_;
|
||||
}
|
||||
|
||||
bool GlobalConfirmResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string GlobalConfirmResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
54
aimath/src/model/UpdateAnalysisRequest.cc
Normal file
54
aimath/src/model/UpdateAnalysisRequest.cc
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aimath/model/UpdateAnalysisRequest.h>
|
||||
|
||||
using AlibabaCloud::AIMath::Model::UpdateAnalysisRequest;
|
||||
|
||||
UpdateAnalysisRequest::UpdateAnalysisRequest()
|
||||
: RpcServiceRequest("aimath", "2024-11-14", "UpdateAnalysis") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateAnalysisRequest::~UpdateAnalysisRequest() {}
|
||||
|
||||
std::string UpdateAnalysisRequest::getContent() const {
|
||||
return content_;
|
||||
}
|
||||
|
||||
void UpdateAnalysisRequest::setContent(const std::string &content) {
|
||||
content_ = content;
|
||||
setBodyParameter(std::string("Content"), content);
|
||||
}
|
||||
|
||||
std::string UpdateAnalysisRequest::getContentCode() const {
|
||||
return contentCode_;
|
||||
}
|
||||
|
||||
void UpdateAnalysisRequest::setContentCode(const std::string &contentCode) {
|
||||
contentCode_ = contentCode;
|
||||
setBodyParameter(std::string("ContentCode"), contentCode);
|
||||
}
|
||||
|
||||
std::string UpdateAnalysisRequest::getExerciseCode() const {
|
||||
return exerciseCode_;
|
||||
}
|
||||
|
||||
void UpdateAnalysisRequest::setExerciseCode(const std::string &exerciseCode) {
|
||||
exerciseCode_ = exerciseCode;
|
||||
setBodyParameter(std::string("ExerciseCode"), exerciseCode);
|
||||
}
|
||||
|
||||
65
aimath/src/model/UpdateAnalysisResult.cc
Normal file
65
aimath/src/model/UpdateAnalysisResult.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/aimath/model/UpdateAnalysisResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AIMath;
|
||||
using namespace AlibabaCloud::AIMath::Model;
|
||||
|
||||
UpdateAnalysisResult::UpdateAnalysisResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdateAnalysisResult::UpdateAnalysisResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdateAnalysisResult::~UpdateAnalysisResult()
|
||||
{}
|
||||
|
||||
void UpdateAnalysisResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
if(!value["ErrMsg"].isNull())
|
||||
errMsg_ = value["ErrMsg"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string UpdateAnalysisResult::getErrMsg()const
|
||||
{
|
||||
return errMsg_;
|
||||
}
|
||||
|
||||
bool UpdateAnalysisResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string UpdateAnalysisResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
54
aimath/src/model/UpdateStepRequest.cc
Normal file
54
aimath/src/model/UpdateStepRequest.cc
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aimath/model/UpdateStepRequest.h>
|
||||
|
||||
using AlibabaCloud::AIMath::Model::UpdateStepRequest;
|
||||
|
||||
UpdateStepRequest::UpdateStepRequest()
|
||||
: RpcServiceRequest("aimath", "2024-11-14", "UpdateStep") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
UpdateStepRequest::~UpdateStepRequest() {}
|
||||
|
||||
std::string UpdateStepRequest::getContent() const {
|
||||
return content_;
|
||||
}
|
||||
|
||||
void UpdateStepRequest::setContent(const std::string &content) {
|
||||
content_ = content;
|
||||
setBodyParameter(std::string("Content"), content);
|
||||
}
|
||||
|
||||
std::string UpdateStepRequest::getContentCode() const {
|
||||
return contentCode_;
|
||||
}
|
||||
|
||||
void UpdateStepRequest::setContentCode(const std::string &contentCode) {
|
||||
contentCode_ = contentCode;
|
||||
setBodyParameter(std::string("ContentCode"), contentCode);
|
||||
}
|
||||
|
||||
std::string UpdateStepRequest::getExerciseCode() const {
|
||||
return exerciseCode_;
|
||||
}
|
||||
|
||||
void UpdateStepRequest::setExerciseCode(const std::string &exerciseCode) {
|
||||
exerciseCode_ = exerciseCode;
|
||||
setBodyParameter(std::string("ExerciseCode"), exerciseCode);
|
||||
}
|
||||
|
||||
65
aimath/src/model/UpdateStepResult.cc
Normal file
65
aimath/src/model/UpdateStepResult.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/aimath/model/UpdateStepResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AIMath;
|
||||
using namespace AlibabaCloud::AIMath::Model;
|
||||
|
||||
UpdateStepResult::UpdateStepResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
UpdateStepResult::UpdateStepResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
UpdateStepResult::~UpdateStepResult()
|
||||
{}
|
||||
|
||||
void UpdateStepResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["ErrCode"].isNull())
|
||||
errCode_ = value["ErrCode"].asString();
|
||||
if(!value["ErrMsg"].isNull())
|
||||
errMsg_ = value["ErrMsg"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string UpdateStepResult::getErrMsg()const
|
||||
{
|
||||
return errMsg_;
|
||||
}
|
||||
|
||||
bool UpdateStepResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string UpdateStepResult::getErrCode()const
|
||||
{
|
||||
return errCode_;
|
||||
}
|
||||
|
||||
90
aipodcast/CMakeLists.txt
Normal file
90
aipodcast/CMakeLists.txt
Normal file
@@ -0,0 +1,90 @@
|
||||
#
|
||||
# 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(aipodcast_public_header
|
||||
include/alibabacloud/aipodcast/AIPodcastClient.h
|
||||
include/alibabacloud/aipodcast/AIPodcastExport.h )
|
||||
|
||||
set(aipodcast_public_header_model
|
||||
include/alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.h
|
||||
include/alibabacloud/aipodcast/model/PodcastTaskResultQueryResult.h
|
||||
include/alibabacloud/aipodcast/model/PodcastTaskSubmitRequest.h
|
||||
include/alibabacloud/aipodcast/model/PodcastTaskSubmitResult.h )
|
||||
|
||||
set(aipodcast_src
|
||||
src/AIPodcastClient.cc
|
||||
src/model/PodcastTaskResultQueryRequest.cc
|
||||
src/model/PodcastTaskResultQueryResult.cc
|
||||
src/model/PodcastTaskSubmitRequest.cc
|
||||
src/model/PodcastTaskSubmitResult.cc )
|
||||
|
||||
add_library(aipodcast ${LIB_TYPE}
|
||||
${aipodcast_public_header}
|
||||
${aipodcast_public_header_model}
|
||||
${aipodcast_src})
|
||||
|
||||
set_target_properties(aipodcast
|
||||
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}aipodcast
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(aipodcast
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_AIPODCAST_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(aipodcast
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(aipodcast
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(aipodcast
|
||||
jsoncpp)
|
||||
target_include_directories(aipodcast
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(aipodcast
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(aipodcast
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(aipodcast
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(aipodcast
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${aipodcast_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aipodcast)
|
||||
install(FILES ${aipodcast_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/aipodcast/model)
|
||||
install(TARGETS aipodcast
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
62
aipodcast/include/alibabacloud/aipodcast/AIPodcastClient.h
Normal file
62
aipodcast/include/alibabacloud/aipodcast/AIPodcastClient.h
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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_
|
||||
#define ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RoaServiceClient.h>
|
||||
#include "AIPodcastExport.h"
|
||||
#include "model/PodcastTaskResultQueryRequest.h"
|
||||
#include "model/PodcastTaskResultQueryResult.h"
|
||||
#include "model/PodcastTaskSubmitRequest.h"
|
||||
#include "model/PodcastTaskSubmitResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIPodcast
|
||||
{
|
||||
class ALIBABACLOUD_AIPODCAST_EXPORT AIPodcastClient : public RoaServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::PodcastTaskResultQueryResult> PodcastTaskResultQueryOutcome;
|
||||
typedef std::future<PodcastTaskResultQueryOutcome> PodcastTaskResultQueryOutcomeCallable;
|
||||
typedef std::function<void(const AIPodcastClient*, const Model::PodcastTaskResultQueryRequest&, const PodcastTaskResultQueryOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PodcastTaskResultQueryAsyncHandler;
|
||||
typedef Outcome<Error, Model::PodcastTaskSubmitResult> PodcastTaskSubmitOutcome;
|
||||
typedef std::future<PodcastTaskSubmitOutcome> PodcastTaskSubmitOutcomeCallable;
|
||||
typedef std::function<void(const AIPodcastClient*, const Model::PodcastTaskSubmitRequest&, const PodcastTaskSubmitOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> PodcastTaskSubmitAsyncHandler;
|
||||
|
||||
AIPodcastClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
AIPodcastClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
AIPodcastClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~AIPodcastClient();
|
||||
PodcastTaskResultQueryOutcome podcastTaskResultQuery(const Model::PodcastTaskResultQueryRequest &request)const;
|
||||
void podcastTaskResultQueryAsync(const Model::PodcastTaskResultQueryRequest& request, const PodcastTaskResultQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
PodcastTaskResultQueryOutcomeCallable podcastTaskResultQueryCallable(const Model::PodcastTaskResultQueryRequest& request) const;
|
||||
PodcastTaskSubmitOutcome podcastTaskSubmit(const Model::PodcastTaskSubmitRequest &request)const;
|
||||
void podcastTaskSubmitAsync(const Model::PodcastTaskSubmitRequest& request, const PodcastTaskSubmitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
PodcastTaskSubmitOutcomeCallable podcastTaskSubmitCallable(const Model::PodcastTaskSubmitRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_AIPODCAST_AIPODCASTCLIENT_H_
|
||||
32
aipodcast/include/alibabacloud/aipodcast/AIPodcastExport.h
Normal file
32
aipodcast/include/alibabacloud/aipodcast/AIPodcastExport.h
Normal file
@@ -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_AIPODCAST_AIPODCASTEXPORT_H_
|
||||
#define ALIBABACLOUD_AIPODCAST_AIPODCASTEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_AIPODCAST_LIBRARY)
|
||||
# define ALIBABACLOUD_AIPODCAST_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_AIPODCAST_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_AIPODCAST_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_AIPODCAST_AIPODCASTEXPORT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_
|
||||
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_
|
||||
|
||||
#include <alibabacloud/aipodcast/AIPodcastExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AIPodcast {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskResultQueryRequest : public RoaServiceRequest {
|
||||
public:
|
||||
PodcastTaskResultQueryRequest();
|
||||
~PodcastTaskResultQueryRequest();
|
||||
std::string getAppId() const;
|
||||
void setAppId(const std::string &appId);
|
||||
std::string getTaskId() const;
|
||||
void setTaskId(const std::string &taskId);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
std::string appId_;
|
||||
std::string taskId_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AIPodcast
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYREQUEST_H_
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_
|
||||
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aipodcast/AIPodcastExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIPodcast
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskResultQueryResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
PodcastTaskResultQueryResult();
|
||||
explicit PodcastTaskResultQueryResult(const std::string &payload);
|
||||
~PodcastTaskResultQueryResult();
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKRESULTQUERYRESULT_H_
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_
|
||||
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_H_
|
||||
|
||||
#include <alibabacloud/aipodcast/AIPodcastExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AIPodcast {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskSubmitRequest : public RoaServiceRequest {
|
||||
public:
|
||||
PodcastTaskSubmitRequest();
|
||||
~PodcastTaskSubmitRequest();
|
||||
std::string getAtmosphere() const;
|
||||
void setAtmosphere(const std::string &atmosphere);
|
||||
std::string getSourceLang() const;
|
||||
void setSourceLang(const std::string &sourceLang);
|
||||
int getCounts() const;
|
||||
void setCounts(int counts);
|
||||
std::vector<std::string> getFileUrls() const;
|
||||
void setFileUrls(const std::vector<std::string> &fileUrls);
|
||||
std::string getText() const;
|
||||
void setText(const std::string &text);
|
||||
std::vector<std::string> getVoices() const;
|
||||
void setVoices(const std::vector<std::string> &voices);
|
||||
std::string getAppId() const;
|
||||
void setAppId(const std::string &appId);
|
||||
std::string getTopic() const;
|
||||
void setTopic(const std::string &topic);
|
||||
std::string getStyle() const;
|
||||
void setStyle(const std::string &style);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
std::string atmosphere_;
|
||||
std::string sourceLang_;
|
||||
int counts_;
|
||||
std::vector<std::string> fileUrls_;
|
||||
std::string text_;
|
||||
std::vector<std::string> voices_;
|
||||
std::string appId_;
|
||||
std::string topic_;
|
||||
std::string style_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AIPodcast
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITREQUEST_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_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_
|
||||
#define ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/aipodcast/AIPodcastExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AIPodcast
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_AIPODCAST_EXPORT PodcastTaskSubmitResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string taskId;
|
||||
std::string taskStatus;
|
||||
};
|
||||
|
||||
|
||||
PodcastTaskSubmitResult();
|
||||
explicit PodcastTaskSubmitResult(const std::string &payload);
|
||||
~PodcastTaskSubmitResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_AIPODCAST_MODEL_PODCASTTASKSUBMITRESULT_H_
|
||||
125
aipodcast/src/AIPodcastClient.cc
Normal file
125
aipodcast/src/AIPodcastClient.cc
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* 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/aipodcast/AIPodcastClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::AIPodcast;
|
||||
using namespace AlibabaCloud::AIPodcast::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "AIPodcast";
|
||||
}
|
||||
|
||||
AIPodcastClient::AIPodcastClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RoaServiceClient(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, "");
|
||||
}
|
||||
|
||||
AIPodcastClient::AIPodcastClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
AIPodcastClient::AIPodcastClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(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, "");
|
||||
}
|
||||
|
||||
AIPodcastClient::~AIPodcastClient()
|
||||
{}
|
||||
|
||||
AIPodcastClient::PodcastTaskResultQueryOutcome AIPodcastClient::podcastTaskResultQuery(const PodcastTaskResultQueryRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return PodcastTaskResultQueryOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return PodcastTaskResultQueryOutcome(PodcastTaskResultQueryResult(outcome.result()));
|
||||
else
|
||||
return PodcastTaskResultQueryOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AIPodcastClient::podcastTaskResultQueryAsync(const PodcastTaskResultQueryRequest& request, const PodcastTaskResultQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, podcastTaskResultQuery(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AIPodcastClient::PodcastTaskResultQueryOutcomeCallable AIPodcastClient::podcastTaskResultQueryCallable(const PodcastTaskResultQueryRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<PodcastTaskResultQueryOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->podcastTaskResultQuery(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AIPodcastClient::PodcastTaskSubmitOutcome AIPodcastClient::podcastTaskSubmit(const PodcastTaskSubmitRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return PodcastTaskSubmitOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return PodcastTaskSubmitOutcome(PodcastTaskSubmitResult(outcome.result()));
|
||||
else
|
||||
return PodcastTaskSubmitOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AIPodcastClient::podcastTaskSubmitAsync(const PodcastTaskSubmitRequest& request, const PodcastTaskSubmitAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, podcastTaskSubmit(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AIPodcastClient::PodcastTaskSubmitOutcomeCallable AIPodcastClient::podcastTaskSubmitCallable(const PodcastTaskSubmitRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<PodcastTaskSubmitOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->podcastTaskSubmit(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
55
aipodcast/src/model/PodcastTaskResultQueryRequest.cc
Normal file
55
aipodcast/src/model/PodcastTaskResultQueryRequest.cc
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/aipodcast/model/PodcastTaskResultQueryRequest.h>
|
||||
|
||||
using AlibabaCloud::AIPodcast::Model::PodcastTaskResultQueryRequest;
|
||||
|
||||
PodcastTaskResultQueryRequest::PodcastTaskResultQueryRequest()
|
||||
: RoaServiceRequest("aipodcast", "2025-02-28") {
|
||||
setResourcePath("/podcast/task"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
PodcastTaskResultQueryRequest::~PodcastTaskResultQueryRequest() {}
|
||||
|
||||
std::string PodcastTaskResultQueryRequest::getAppId() const {
|
||||
return appId_;
|
||||
}
|
||||
|
||||
void PodcastTaskResultQueryRequest::setAppId(const std::string &appId) {
|
||||
appId_ = appId;
|
||||
setBodyParameter(std::string("appId"), appId);
|
||||
}
|
||||
|
||||
std::string PodcastTaskResultQueryRequest::getTaskId() const {
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void PodcastTaskResultQueryRequest::setTaskId(const std::string &taskId) {
|
||||
taskId_ = taskId;
|
||||
setBodyParameter(std::string("taskId"), taskId);
|
||||
}
|
||||
|
||||
std::string PodcastTaskResultQueryRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void PodcastTaskResultQueryRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
44
aipodcast/src/model/PodcastTaskResultQueryResult.cc
Normal file
44
aipodcast/src/model/PodcastTaskResultQueryResult.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/aipodcast/model/PodcastTaskResultQueryResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AIPodcast;
|
||||
using namespace AlibabaCloud::AIPodcast::Model;
|
||||
|
||||
PodcastTaskResultQueryResult::PodcastTaskResultQueryResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
PodcastTaskResultQueryResult::PodcastTaskResultQueryResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
PodcastTaskResultQueryResult::~PodcastTaskResultQueryResult()
|
||||
{}
|
||||
|
||||
void PodcastTaskResultQueryResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
|
||||
}
|
||||
|
||||
122
aipodcast/src/model/PodcastTaskSubmitRequest.cc
Normal file
122
aipodcast/src/model/PodcastTaskSubmitRequest.cc
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* 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/aipodcast/model/PodcastTaskSubmitRequest.h>
|
||||
|
||||
using AlibabaCloud::AIPodcast::Model::PodcastTaskSubmitRequest;
|
||||
|
||||
PodcastTaskSubmitRequest::PodcastTaskSubmitRequest()
|
||||
: RoaServiceRequest("aipodcast", "2025-02-28") {
|
||||
setResourcePath("/podcast/task/submit"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
PodcastTaskSubmitRequest::~PodcastTaskSubmitRequest() {}
|
||||
|
||||
std::string PodcastTaskSubmitRequest::getAtmosphere() const {
|
||||
return atmosphere_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setAtmosphere(const std::string &atmosphere) {
|
||||
atmosphere_ = atmosphere;
|
||||
setBodyParameter(std::string("atmosphere"), atmosphere);
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitRequest::getSourceLang() const {
|
||||
return sourceLang_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setSourceLang(const std::string &sourceLang) {
|
||||
sourceLang_ = sourceLang;
|
||||
setBodyParameter(std::string("sourceLang"), sourceLang);
|
||||
}
|
||||
|
||||
int PodcastTaskSubmitRequest::getCounts() const {
|
||||
return counts_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setCounts(int counts) {
|
||||
counts_ = counts;
|
||||
setBodyParameter(std::string("counts"), std::to_string(counts));
|
||||
}
|
||||
|
||||
std::vector<PodcastTaskSubmitRequest::std::string> PodcastTaskSubmitRequest::getFileUrls() const {
|
||||
return fileUrls_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setFileUrls(const std::vector<PodcastTaskSubmitRequest::std::string> &fileUrls) {
|
||||
fileUrls_ = fileUrls;
|
||||
for(int dep1 = 0; dep1 != fileUrls.size(); dep1++) {
|
||||
setBodyParameter(std::string("fileUrls") + "." + std::to_string(dep1 + 1), fileUrls[dep1]);
|
||||
}
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setText(const std::string &text) {
|
||||
text_ = text;
|
||||
setBodyParameter(std::string("text"), text);
|
||||
}
|
||||
|
||||
std::vector<PodcastTaskSubmitRequest::std::string> PodcastTaskSubmitRequest::getVoices() const {
|
||||
return voices_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setVoices(const std::vector<PodcastTaskSubmitRequest::std::string> &voices) {
|
||||
voices_ = voices;
|
||||
for(int dep1 = 0; dep1 != voices.size(); dep1++) {
|
||||
setBodyParameter(std::string("voices") + "." + std::to_string(dep1 + 1), voices[dep1]);
|
||||
}
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitRequest::getAppId() const {
|
||||
return appId_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setAppId(const std::string &appId) {
|
||||
appId_ = appId;
|
||||
setBodyParameter(std::string("appId"), appId);
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitRequest::getTopic() const {
|
||||
return topic_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setTopic(const std::string &topic) {
|
||||
topic_ = topic;
|
||||
setBodyParameter(std::string("topic"), topic);
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitRequest::getStyle() const {
|
||||
return style_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setStyle(const std::string &style) {
|
||||
style_ = style;
|
||||
setBodyParameter(std::string("style"), style);
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void PodcastTaskSubmitRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
89
aipodcast/src/model/PodcastTaskSubmitResult.cc
Normal file
89
aipodcast/src/model/PodcastTaskSubmitResult.cc
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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/aipodcast/model/PodcastTaskSubmitResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AIPodcast;
|
||||
using namespace AlibabaCloud::AIPodcast::Model;
|
||||
|
||||
PodcastTaskSubmitResult::PodcastTaskSubmitResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
PodcastTaskSubmitResult::PodcastTaskSubmitResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
PodcastTaskSubmitResult::~PodcastTaskSubmitResult()
|
||||
{}
|
||||
|
||||
void PodcastTaskSubmitResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
if(!dataNode["taskId"].isNull())
|
||||
data_.taskId = dataNode["taskId"].asString();
|
||||
if(!dataNode["taskStatus"].isNull())
|
||||
data_.taskStatus = dataNode["taskStatus"].asString();
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
PodcastTaskSubmitResult::Data PodcastTaskSubmitResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string PodcastTaskSubmitResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool PodcastTaskSubmitResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ public:
|
||||
std::string xForwardedForClientCertSubjectDNAlias;
|
||||
bool xForwardedForClientSourceIpsEnabled;
|
||||
bool xForwardedForClientCertIssuerDNEnabled;
|
||||
bool xForwardedForHostEnabled;
|
||||
std::string xForwardedForProcessingMode;
|
||||
bool xForwardedForClientCertFingerprintEnabled;
|
||||
std::string xForwardedForClientCertIssuerDNAlias;
|
||||
bool xForwardedForProtoEnabled;
|
||||
|
||||
@@ -70,6 +70,8 @@ public:
|
||||
};
|
||||
CreateServerGroupRequest();
|
||||
~CreateServerGroupRequest();
|
||||
bool getCrossZoneEnabled() const;
|
||||
void setCrossZoneEnabled(bool crossZoneEnabled);
|
||||
std::string getServerGroupName() const;
|
||||
void setServerGroupName(const std::string &serverGroupName);
|
||||
std::string getClientToken() const;
|
||||
@@ -106,6 +108,7 @@ public:
|
||||
void setUchConfig(const UchConfig &uchConfig);
|
||||
|
||||
private:
|
||||
bool crossZoneEnabled_;
|
||||
std::string serverGroupName_;
|
||||
std::string clientToken_;
|
||||
HealthCheckConfig healthCheckConfig_;
|
||||
|
||||
@@ -63,6 +63,7 @@ namespace AlibabaCloud
|
||||
bool xForwardedForClientSourceIpsEnabled;
|
||||
std::string xForwardedForClientCertFingerprintAlias;
|
||||
bool xForwardedForClientCertFingerprintEnabled;
|
||||
bool xForwardedForHostEnabled;
|
||||
std::string xForwardedForClientSourceIpsTrusted;
|
||||
std::string xForwardedForClientCertIssuerDNAlias;
|
||||
std::string xForwardedForClientCertClientVerifyAlias;
|
||||
@@ -72,6 +73,7 @@ namespace AlibabaCloud
|
||||
bool xForwardedForProtoEnabled;
|
||||
bool xForwardedForClientSrcPortEnabled;
|
||||
bool xForwardedForEnabled;
|
||||
std::string xForwardedForProcessingMode;
|
||||
bool xForwardedForSLBPortEnabled;
|
||||
bool xForwardedForClientCertIssuerDNEnabled;
|
||||
bool xForwardedForClientCertClientVerifyEnabled;
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace AlibabaCloud
|
||||
bool xForwardedForClientSourceIpsEnabled;
|
||||
std::string xForwardedForClientCertFingerprintAlias;
|
||||
bool xForwardedForClientCertFingerprintEnabled;
|
||||
bool xForwardedForHostEnabled;
|
||||
std::string xForwardedForClientSourceIpsTrusted;
|
||||
std::string xForwardedForClientCertIssuerDNAlias;
|
||||
std::string xForwardedForClientCertClientVerifyAlias;
|
||||
@@ -64,6 +65,7 @@ namespace AlibabaCloud
|
||||
bool xForwardedForProtoEnabled;
|
||||
bool xForwardedForClientSrcPortEnabled;
|
||||
bool xForwardedForEnabled;
|
||||
std::string xForwardedForProcessingMode;
|
||||
bool xForwardedForSLBPortEnabled;
|
||||
bool xForwardedForClientCertIssuerDNEnabled;
|
||||
bool xForwardedForClientCertClientVerifyEnabled;
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace AlibabaCloud
|
||||
std::string scheduler;
|
||||
std::vector<std::string> relatedRuleIds;
|
||||
int serverCount;
|
||||
bool crossZoneEnabled;
|
||||
bool ipv6Enabled;
|
||||
SlowStartConfig slowStartConfig;
|
||||
std::string serviceManagedMode;
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
std::string xForwardedForClientCertSubjectDNAlias;
|
||||
bool xForwardedForClientSourceIpsEnabled;
|
||||
bool xForwardedForClientCertIssuerDNEnabled;
|
||||
bool xForwardedForHostEnabled;
|
||||
std::string xForwardedForProcessingMode;
|
||||
bool xForwardedForClientCertFingerprintEnabled;
|
||||
std::string xForwardedForClientCertIssuerDNAlias;
|
||||
bool xForwardedForProtoEnabled;
|
||||
|
||||
@@ -66,6 +66,8 @@ public:
|
||||
};
|
||||
UpdateServerGroupAttributeRequest();
|
||||
~UpdateServerGroupAttributeRequest();
|
||||
bool getCrossZoneEnabled() const;
|
||||
void setCrossZoneEnabled(bool crossZoneEnabled);
|
||||
std::string getServerGroupName() const;
|
||||
void setServerGroupName(const std::string &serverGroupName);
|
||||
std::string getClientToken() const;
|
||||
@@ -92,6 +94,7 @@ public:
|
||||
void setUchConfig(const UchConfig &uchConfig);
|
||||
|
||||
private:
|
||||
bool crossZoneEnabled_;
|
||||
std::string serverGroupName_;
|
||||
std::string clientToken_;
|
||||
HealthCheckConfig healthCheckConfig_;
|
||||
|
||||
@@ -136,6 +136,8 @@ void CreateListenerRequest::setXForwardedForConfig(const CreateListenerRequest::
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertSubjectDNAlias", xForwardedForConfig.xForwardedForClientCertSubjectDNAlias);
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientSourceIpsEnabled", xForwardedForConfig.xForwardedForClientSourceIpsEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertIssuerDNEnabled", xForwardedForConfig.xForwardedForClientCertIssuerDNEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForHostEnabled", xForwardedForConfig.xForwardedForHostEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForProcessingMode", xForwardedForConfig.xForwardedForProcessingMode);
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertFingerprintEnabled", xForwardedForConfig.xForwardedForClientCertFingerprintEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertIssuerDNAlias", xForwardedForConfig.xForwardedForClientCertIssuerDNAlias);
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForProtoEnabled", xForwardedForConfig.xForwardedForProtoEnabled ? "true" : "false");
|
||||
|
||||
@@ -43,92 +43,92 @@ void CreateRulesRequest::setRules(const std::vector<CreateRulesRequest::Rules> &
|
||||
for(int dep1 = 0; dep1 != rules.size(); dep1++) {
|
||||
for(int dep2 = 0; dep2 != rules[dep1].ruleConditions.size(); dep2++) {
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].methodConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".MethodConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].methodConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".MethodConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].methodConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].sourceIpConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".SourceIpConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].sourceIpConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".SourceIpConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].sourceIpConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].hostConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HostConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].hostConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HostConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].hostConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].queryStringConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].value);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].value);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].key);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].responseStatusCodeConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseStatusCodeConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseStatusCodeConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseStatusCodeConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseStatusCodeConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].pathConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".PathConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].pathConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".PathConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].pathConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].cookieConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].value);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].value);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].key);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleConditions[dep2].type);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleConditions[dep2].type);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].headerConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].headerConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].headerConfig.values[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Key", rules[dep1].ruleConditions[dep2].headerConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Key", rules[dep1].ruleConditions[dep2].headerConfig.key);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].responseHeaderConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseHeaderConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseHeaderConfig.values[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Key", rules[dep1].ruleConditions[dep2].responseHeaderConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Key", rules[dep1].ruleConditions[dep2].responseHeaderConfig.key);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleName", rules[dep1].ruleName);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleName", rules[dep1].ruleName);
|
||||
for(int dep2 = 0; dep2 != rules[dep1].tag.size(); dep2++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Tag." + std::to_string(dep2 + 1) + ".Value", rules[dep1].tag[dep2].value);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Tag." + std::to_string(dep2 + 1) + ".Key", rules[dep1].tag[dep2].key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Tag." + std::to_string(dep2 + 1) + ".Value", rules[dep1].tag[dep2].value);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Tag." + std::to_string(dep2 + 1) + ".Key", rules[dep1].tag[dep2].key);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Priority", std::to_string(rules[dep1].priority));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Priority", std::to_string(rules[dep1].priority));
|
||||
for(int dep2 = 0; dep2 != rules[dep1].ruleActions.size(); dep2++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.HttpCode", rules[dep1].ruleActions[dep2].fixedResponseConfig.httpCode);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.Content", rules[dep1].ruleActions[dep2].fixedResponseConfig.content);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.ContentType", rules[dep1].ruleActions[dep2].fixedResponseConfig.contentType);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.HttpCode", rules[dep1].ruleActions[dep2].fixedResponseConfig.httpCode);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.Content", rules[dep1].ruleActions[dep2].fixedResponseConfig.content);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.ContentType", rules[dep1].ruleActions[dep2].fixedResponseConfig.contentType);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].trafficMirrorConfig.mirrorGroupConfig.serverGroupTuples.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.MirrorGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].trafficMirrorConfig.mirrorGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.MirrorGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].trafficMirrorConfig.mirrorGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.TargetType", rules[dep1].ruleActions[dep2].trafficMirrorConfig.targetType);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Enabled", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.enabled ? "true" : "false");
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Timeout", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.timeout));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.TargetType", rules[dep1].ruleActions[dep2].trafficMirrorConfig.targetType);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Enabled", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.enabled ? "true" : "false");
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Timeout", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.timeout));
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".Weight", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].weight));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".Weight", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].weight));
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RemoveHeaderConfig.Key", rules[dep1].ruleActions[dep2].removeHeaderConfig.key);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.ValueType", rules[dep1].ruleActions[dep2].insertHeaderConfig.valueType);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.CoverEnabled", rules[dep1].ruleActions[dep2].insertHeaderConfig.coverEnabled ? "true" : "false");
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Value", rules[dep1].ruleActions[dep2].insertHeaderConfig.value);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Key", rules[dep1].ruleActions[dep2].insertHeaderConfig.key);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.QPS", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.qPS));
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.PerIpQps", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.perIpQps));
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowCredentials", rules[dep1].ruleActions[dep2].corsConfig.allowCredentials);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RemoveHeaderConfig.Key", rules[dep1].ruleActions[dep2].removeHeaderConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.ValueType", rules[dep1].ruleActions[dep2].insertHeaderConfig.valueType);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.CoverEnabled", rules[dep1].ruleActions[dep2].insertHeaderConfig.coverEnabled ? "true" : "false");
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Value", rules[dep1].ruleActions[dep2].insertHeaderConfig.value);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Key", rules[dep1].ruleActions[dep2].insertHeaderConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.QPS", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.qPS));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.PerIpQps", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.perIpQps));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowCredentials", rules[dep1].ruleActions[dep2].corsConfig.allowCredentials);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.allowOrigin.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowOrigin." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowOrigin[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowOrigin." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowOrigin[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.MaxAge", std::to_string(rules[dep1].ruleActions[dep2].corsConfig.maxAge));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.MaxAge", std::to_string(rules[dep1].ruleActions[dep2].corsConfig.maxAge));
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.allowMethods.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowMethods." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowMethods[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowMethods." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowMethods[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.allowHeaders.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowHeaders[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowHeaders[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.exposeHeaders.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.ExposeHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.exposeHeaders[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.ExposeHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.exposeHeaders[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Path", rules[dep1].ruleActions[dep2].redirectConfig.path);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Protocol", rules[dep1].ruleActions[dep2].redirectConfig.protocol);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Port", rules[dep1].ruleActions[dep2].redirectConfig.port);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Query", rules[dep1].ruleActions[dep2].redirectConfig.query);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Host", rules[dep1].ruleActions[dep2].redirectConfig.host);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.HttpCode", rules[dep1].ruleActions[dep2].redirectConfig.httpCode);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleActions[dep2].type);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Order", std::to_string(rules[dep1].ruleActions[dep2].order));
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Path", rules[dep1].ruleActions[dep2].rewriteConfig.path);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Query", rules[dep1].ruleActions[dep2].rewriteConfig.query);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Host", rules[dep1].ruleActions[dep2].rewriteConfig.host);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Path", rules[dep1].ruleActions[dep2].redirectConfig.path);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Protocol", rules[dep1].ruleActions[dep2].redirectConfig.protocol);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Port", rules[dep1].ruleActions[dep2].redirectConfig.port);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Query", rules[dep1].ruleActions[dep2].redirectConfig.query);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Host", rules[dep1].ruleActions[dep2].redirectConfig.host);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.HttpCode", rules[dep1].ruleActions[dep2].redirectConfig.httpCode);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleActions[dep2].type);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Order", std::to_string(rules[dep1].ruleActions[dep2].order));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Path", rules[dep1].ruleActions[dep2].rewriteConfig.path);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Query", rules[dep1].ruleActions[dep2].rewriteConfig.query);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Host", rules[dep1].ruleActions[dep2].rewriteConfig.host);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Direction", rules[dep1].direction);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Direction", rules[dep1].direction);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,15 @@ CreateServerGroupRequest::CreateServerGroupRequest()
|
||||
|
||||
CreateServerGroupRequest::~CreateServerGroupRequest() {}
|
||||
|
||||
bool CreateServerGroupRequest::getCrossZoneEnabled() const {
|
||||
return crossZoneEnabled_;
|
||||
}
|
||||
|
||||
void CreateServerGroupRequest::setCrossZoneEnabled(bool crossZoneEnabled) {
|
||||
crossZoneEnabled_ = crossZoneEnabled;
|
||||
setParameter(std::string("CrossZoneEnabled"), crossZoneEnabled ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string CreateServerGroupRequest::getServerGroupName() const {
|
||||
return serverGroupName_;
|
||||
}
|
||||
|
||||
@@ -151,6 +151,8 @@ void GetListenerAttributeResult::parse(const std::string &payload)
|
||||
xForwardedForConfig_.xForwardedForClientSrcPortEnabled = xForwardedForConfigNode["XForwardedForClientSrcPortEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForEnabled"].isNull())
|
||||
xForwardedForConfig_.xForwardedForEnabled = xForwardedForConfigNode["XForwardedForEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForProcessingMode"].isNull())
|
||||
xForwardedForConfig_.xForwardedForProcessingMode = xForwardedForConfigNode["XForwardedForProcessingMode"].asString();
|
||||
if(!xForwardedForConfigNode["XForwardedForProtoEnabled"].isNull())
|
||||
xForwardedForConfig_.xForwardedForProtoEnabled = xForwardedForConfigNode["XForwardedForProtoEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForSLBIdEnabled"].isNull())
|
||||
@@ -161,6 +163,8 @@ void GetListenerAttributeResult::parse(const std::string &payload)
|
||||
xForwardedForConfig_.xForwardedForClientSourceIpsEnabled = xForwardedForConfigNode["XForwardedForClientSourceIpsEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForClientSourceIpsTrusted"].isNull())
|
||||
xForwardedForConfig_.xForwardedForClientSourceIpsTrusted = xForwardedForConfigNode["XForwardedForClientSourceIpsTrusted"].asString();
|
||||
if(!xForwardedForConfigNode["XForwardedForHostEnabled"].isNull())
|
||||
xForwardedForConfig_.xForwardedForHostEnabled = xForwardedForConfigNode["XForwardedForHostEnabled"].asString() == "true";
|
||||
if(!value["CaEnabled"].isNull())
|
||||
caEnabled_ = value["CaEnabled"].asString() == "true";
|
||||
if(!value["GzipEnabled"].isNull())
|
||||
|
||||
@@ -148,6 +148,8 @@ void ListListenersResult::parse(const std::string &payload)
|
||||
listenersObject.xForwardedForConfig.xForwardedForClientSrcPortEnabled = xForwardedForConfigNode["XForwardedForClientSrcPortEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForEnabled"].isNull())
|
||||
listenersObject.xForwardedForConfig.xForwardedForEnabled = xForwardedForConfigNode["XForwardedForEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForProcessingMode"].isNull())
|
||||
listenersObject.xForwardedForConfig.xForwardedForProcessingMode = xForwardedForConfigNode["XForwardedForProcessingMode"].asString();
|
||||
if(!xForwardedForConfigNode["XForwardedForProtoEnabled"].isNull())
|
||||
listenersObject.xForwardedForConfig.xForwardedForProtoEnabled = xForwardedForConfigNode["XForwardedForProtoEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForSLBIdEnabled"].isNull())
|
||||
@@ -158,6 +160,8 @@ void ListListenersResult::parse(const std::string &payload)
|
||||
listenersObject.xForwardedForConfig.xForwardedForClientSourceIpsEnabled = xForwardedForConfigNode["XForwardedForClientSourceIpsEnabled"].asString() == "true";
|
||||
if(!xForwardedForConfigNode["XForwardedForClientSourceIpsTrusted"].isNull())
|
||||
listenersObject.xForwardedForConfig.xForwardedForClientSourceIpsTrusted = xForwardedForConfigNode["XForwardedForClientSourceIpsTrusted"].asString();
|
||||
if(!xForwardedForConfigNode["XForwardedForHostEnabled"].isNull())
|
||||
listenersObject.xForwardedForConfig.xForwardedForHostEnabled = xForwardedForConfigNode["XForwardedForHostEnabled"].asString() == "true";
|
||||
listeners_.push_back(listenersObject);
|
||||
}
|
||||
if(!value["MaxResults"].isNull())
|
||||
|
||||
@@ -75,6 +75,8 @@ void ListServerGroupsResult::parse(const std::string &payload)
|
||||
serverGroupsObject.serviceName = valueServerGroupsServerGroup["ServiceName"].asString();
|
||||
if(!valueServerGroupsServerGroup["CreateTime"].isNull())
|
||||
serverGroupsObject.createTime = valueServerGroupsServerGroup["CreateTime"].asString();
|
||||
if(!valueServerGroupsServerGroup["CrossZoneEnabled"].isNull())
|
||||
serverGroupsObject.crossZoneEnabled = valueServerGroupsServerGroup["CrossZoneEnabled"].asString() == "true";
|
||||
auto allTagsNode = valueServerGroupsServerGroup["Tags"]["Tag"];
|
||||
for (auto valueServerGroupsServerGroupTagsTag : allTagsNode)
|
||||
{
|
||||
|
||||
@@ -124,6 +124,8 @@ void UpdateListenerAttributeRequest::setXForwardedForConfig(const UpdateListener
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertSubjectDNAlias", xForwardedForConfig.xForwardedForClientCertSubjectDNAlias);
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientSourceIpsEnabled", xForwardedForConfig.xForwardedForClientSourceIpsEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertIssuerDNEnabled", xForwardedForConfig.xForwardedForClientCertIssuerDNEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForHostEnabled", xForwardedForConfig.xForwardedForHostEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForProcessingMode", xForwardedForConfig.xForwardedForProcessingMode);
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertFingerprintEnabled", xForwardedForConfig.xForwardedForClientCertFingerprintEnabled ? "true" : "false");
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForClientCertIssuerDNAlias", xForwardedForConfig.xForwardedForClientCertIssuerDNAlias);
|
||||
setParameter(std::string("XForwardedForConfig") + ".XForwardedForProtoEnabled", xForwardedForConfig.xForwardedForProtoEnabled ? "true" : "false");
|
||||
|
||||
@@ -43,87 +43,87 @@ void UpdateRulesAttributeRequest::setRules(const std::vector<UpdateRulesAttribut
|
||||
for(int dep1 = 0; dep1 != rules.size(); dep1++) {
|
||||
for(int dep2 = 0; dep2 != rules[dep1].ruleConditions.size(); dep2++) {
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].methodConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".MethodConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].methodConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".MethodConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].methodConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].sourceIpConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".SourceIpConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].sourceIpConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".SourceIpConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].sourceIpConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].hostConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HostConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].hostConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HostConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].hostConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].queryStringConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].value);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].value);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".QueryStringConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].queryStringConfig.values[dep3].key);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].responseStatusCodeConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseStatusCodeConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseStatusCodeConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseStatusCodeConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseStatusCodeConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].pathConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".PathConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].pathConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".PathConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].pathConfig.values[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].cookieConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].value);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Value", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].value);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".CookieConfig.Values." + std::to_string(dep3 + 1) + ".Key", rules[dep1].ruleConditions[dep2].cookieConfig.values[dep3].key);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleConditions[dep2].type);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleConditions[dep2].type);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].headerConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].headerConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].headerConfig.values[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Key", rules[dep1].ruleConditions[dep2].headerConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".HeaderConfig.Key", rules[dep1].ruleConditions[dep2].headerConfig.key);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleConditions[dep2].responseHeaderConfig.values.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseHeaderConfig.values[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Values." + std::to_string(dep3 + 1), rules[dep1].ruleConditions[dep2].responseHeaderConfig.values[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Key", rules[dep1].ruleConditions[dep2].responseHeaderConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleConditions." + std::to_string(dep2 + 1) + ".ResponseHeaderConfig.Key", rules[dep1].ruleConditions[dep2].responseHeaderConfig.key);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleName", rules[dep1].ruleName);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Priority", std::to_string(rules[dep1].priority));
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleId", rules[dep1].ruleId);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleName", rules[dep1].ruleName);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".Priority", std::to_string(rules[dep1].priority));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleId", rules[dep1].ruleId);
|
||||
for(int dep2 = 0; dep2 != rules[dep1].ruleActions.size(); dep2++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.HttpCode", rules[dep1].ruleActions[dep2].fixedResponseConfig.httpCode);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.Content", rules[dep1].ruleActions[dep2].fixedResponseConfig.content);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.ContentType", rules[dep1].ruleActions[dep2].fixedResponseConfig.contentType);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.HttpCode", rules[dep1].ruleActions[dep2].fixedResponseConfig.httpCode);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.Content", rules[dep1].ruleActions[dep2].fixedResponseConfig.content);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".FixedResponseConfig.ContentType", rules[dep1].ruleActions[dep2].fixedResponseConfig.contentType);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].trafficMirrorConfig.mirrorGroupConfig.serverGroupTuples.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.MirrorGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].trafficMirrorConfig.mirrorGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.MirrorGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].trafficMirrorConfig.mirrorGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.TargetType", rules[dep1].ruleActions[dep2].trafficMirrorConfig.targetType);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Enabled", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.enabled ? "true" : "false");
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Timeout", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.timeout));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficMirrorConfig.TargetType", rules[dep1].ruleActions[dep2].trafficMirrorConfig.targetType);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Enabled", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.enabled ? "true" : "false");
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupStickySession.Timeout", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupStickySession.timeout));
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".Weight", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].weight));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".ServerGroupId", rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].serverGroupId);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".ForwardGroupConfig.ServerGroupTuples." + std::to_string(dep3 + 1) + ".Weight", std::to_string(rules[dep1].ruleActions[dep2].forwardGroupConfig.serverGroupTuples[dep3].weight));
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RemoveHeaderConfig.Key", rules[dep1].ruleActions[dep2].removeHeaderConfig.key);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.ValueType", rules[dep1].ruleActions[dep2].insertHeaderConfig.valueType);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.CoverEnabled", rules[dep1].ruleActions[dep2].insertHeaderConfig.coverEnabled ? "true" : "false");
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Value", rules[dep1].ruleActions[dep2].insertHeaderConfig.value);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Key", rules[dep1].ruleActions[dep2].insertHeaderConfig.key);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.QPS", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.qPS));
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.PerIpQps", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.perIpQps));
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowCredentials", rules[dep1].ruleActions[dep2].corsConfig.allowCredentials);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RemoveHeaderConfig.Key", rules[dep1].ruleActions[dep2].removeHeaderConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.ValueType", rules[dep1].ruleActions[dep2].insertHeaderConfig.valueType);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.CoverEnabled", rules[dep1].ruleActions[dep2].insertHeaderConfig.coverEnabled ? "true" : "false");
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Value", rules[dep1].ruleActions[dep2].insertHeaderConfig.value);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".InsertHeaderConfig.Key", rules[dep1].ruleActions[dep2].insertHeaderConfig.key);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.QPS", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.qPS));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".TrafficLimitConfig.PerIpQps", std::to_string(rules[dep1].ruleActions[dep2].trafficLimitConfig.perIpQps));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowCredentials", rules[dep1].ruleActions[dep2].corsConfig.allowCredentials);
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.allowOrigin.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowOrigin." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowOrigin[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowOrigin." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowOrigin[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.MaxAge", std::to_string(rules[dep1].ruleActions[dep2].corsConfig.maxAge));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.MaxAge", std::to_string(rules[dep1].ruleActions[dep2].corsConfig.maxAge));
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.allowMethods.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowMethods." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowMethods[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowMethods." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowMethods[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.allowHeaders.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowHeaders[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.AllowHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.allowHeaders[dep3]);
|
||||
}
|
||||
for(int dep3 = 0; dep3 != rules[dep1].ruleActions[dep2].corsConfig.exposeHeaders.size(); dep3++) {
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.ExposeHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.exposeHeaders[dep3]);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".CorsConfig.ExposeHeaders." + std::to_string(dep3 + 1), rules[dep1].ruleActions[dep2].corsConfig.exposeHeaders[dep3]);
|
||||
}
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Path", rules[dep1].ruleActions[dep2].redirectConfig.path);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Protocol", rules[dep1].ruleActions[dep2].redirectConfig.protocol);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Port", rules[dep1].ruleActions[dep2].redirectConfig.port);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Query", rules[dep1].ruleActions[dep2].redirectConfig.query);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Host", rules[dep1].ruleActions[dep2].redirectConfig.host);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.HttpCode", rules[dep1].ruleActions[dep2].redirectConfig.httpCode);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleActions[dep2].type);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Order", std::to_string(rules[dep1].ruleActions[dep2].order));
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Path", rules[dep1].ruleActions[dep2].rewriteConfig.path);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Query", rules[dep1].ruleActions[dep2].rewriteConfig.query);
|
||||
setParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Host", rules[dep1].ruleActions[dep2].rewriteConfig.host);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Path", rules[dep1].ruleActions[dep2].redirectConfig.path);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Protocol", rules[dep1].ruleActions[dep2].redirectConfig.protocol);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Port", rules[dep1].ruleActions[dep2].redirectConfig.port);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Query", rules[dep1].ruleActions[dep2].redirectConfig.query);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.Host", rules[dep1].ruleActions[dep2].redirectConfig.host);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RedirectConfig.HttpCode", rules[dep1].ruleActions[dep2].redirectConfig.httpCode);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Type", rules[dep1].ruleActions[dep2].type);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".Order", std::to_string(rules[dep1].ruleActions[dep2].order));
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Path", rules[dep1].ruleActions[dep2].rewriteConfig.path);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Query", rules[dep1].ruleActions[dep2].rewriteConfig.query);
|
||||
setBodyParameter(std::string("Rules") + "." + std::to_string(dep1 + 1) + ".RuleActions." + std::to_string(dep2 + 1) + ".RewriteConfig.Host", rules[dep1].ruleActions[dep2].rewriteConfig.host);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,15 @@ UpdateServerGroupAttributeRequest::UpdateServerGroupAttributeRequest()
|
||||
|
||||
UpdateServerGroupAttributeRequest::~UpdateServerGroupAttributeRequest() {}
|
||||
|
||||
bool UpdateServerGroupAttributeRequest::getCrossZoneEnabled() const {
|
||||
return crossZoneEnabled_;
|
||||
}
|
||||
|
||||
void UpdateServerGroupAttributeRequest::setCrossZoneEnabled(bool crossZoneEnabled) {
|
||||
crossZoneEnabled_ = crossZoneEnabled;
|
||||
setParameter(std::string("CrossZoneEnabled"), crossZoneEnabled ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string UpdateServerGroupAttributeRequest::getServerGroupName() const {
|
||||
return serverGroupName_;
|
||||
}
|
||||
|
||||
134
anytrans/CMakeLists.txt
Normal file
134
anytrans/CMakeLists.txt
Normal file
@@ -0,0 +1,134 @@
|
||||
#
|
||||
# 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(anytrans_public_header
|
||||
include/alibabacloud/anytrans/AnyTransClient.h
|
||||
include/alibabacloud/anytrans/AnyTransExport.h )
|
||||
|
||||
set(anytrans_public_header_model
|
||||
include/alibabacloud/anytrans/model/BatchTranslateRequest.h
|
||||
include/alibabacloud/anytrans/model/BatchTranslateResult.h
|
||||
include/alibabacloud/anytrans/model/BatchTranslateForHtmlRequest.h
|
||||
include/alibabacloud/anytrans/model/BatchTranslateForHtmlResult.h
|
||||
include/alibabacloud/anytrans/model/GetDocTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/GetDocTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/GetHtmlTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/GetHtmlTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/GetImageTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/GetImageTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/GetLongTextTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/GetLongTextTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/SubmitDocTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/SubmitDocTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/SubmitHtmlTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/SubmitHtmlTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/SubmitImageTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/SubmitImageTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/SubmitLongTextTranslateTaskRequest.h
|
||||
include/alibabacloud/anytrans/model/SubmitLongTextTranslateTaskResult.h
|
||||
include/alibabacloud/anytrans/model/TermEditRequest.h
|
||||
include/alibabacloud/anytrans/model/TermEditResult.h
|
||||
include/alibabacloud/anytrans/model/TermQueryRequest.h
|
||||
include/alibabacloud/anytrans/model/TermQueryResult.h
|
||||
include/alibabacloud/anytrans/model/TextTranslateRequest.h
|
||||
include/alibabacloud/anytrans/model/TextTranslateResult.h )
|
||||
|
||||
set(anytrans_src
|
||||
src/AnyTransClient.cc
|
||||
src/model/BatchTranslateRequest.cc
|
||||
src/model/BatchTranslateResult.cc
|
||||
src/model/BatchTranslateForHtmlRequest.cc
|
||||
src/model/BatchTranslateForHtmlResult.cc
|
||||
src/model/GetDocTranslateTaskRequest.cc
|
||||
src/model/GetDocTranslateTaskResult.cc
|
||||
src/model/GetHtmlTranslateTaskRequest.cc
|
||||
src/model/GetHtmlTranslateTaskResult.cc
|
||||
src/model/GetImageTranslateTaskRequest.cc
|
||||
src/model/GetImageTranslateTaskResult.cc
|
||||
src/model/GetLongTextTranslateTaskRequest.cc
|
||||
src/model/GetLongTextTranslateTaskResult.cc
|
||||
src/model/SubmitDocTranslateTaskRequest.cc
|
||||
src/model/SubmitDocTranslateTaskResult.cc
|
||||
src/model/SubmitHtmlTranslateTaskRequest.cc
|
||||
src/model/SubmitHtmlTranslateTaskResult.cc
|
||||
src/model/SubmitImageTranslateTaskRequest.cc
|
||||
src/model/SubmitImageTranslateTaskResult.cc
|
||||
src/model/SubmitLongTextTranslateTaskRequest.cc
|
||||
src/model/SubmitLongTextTranslateTaskResult.cc
|
||||
src/model/TermEditRequest.cc
|
||||
src/model/TermEditResult.cc
|
||||
src/model/TermQueryRequest.cc
|
||||
src/model/TermQueryResult.cc
|
||||
src/model/TextTranslateRequest.cc
|
||||
src/model/TextTranslateResult.cc )
|
||||
|
||||
add_library(anytrans ${LIB_TYPE}
|
||||
${anytrans_public_header}
|
||||
${anytrans_public_header_model}
|
||||
${anytrans_src})
|
||||
|
||||
set_target_properties(anytrans
|
||||
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}anytrans
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(anytrans
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_ANYTRANS_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(anytrans
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(anytrans
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(anytrans
|
||||
jsoncpp)
|
||||
target_include_directories(anytrans
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(anytrans
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(anytrans
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(anytrans
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(anytrans
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${anytrans_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/anytrans)
|
||||
install(FILES ${anytrans_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/anytrans/model)
|
||||
install(TARGETS anytrans
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
150
anytrans/include/alibabacloud/anytrans/AnyTransClient.h
Normal file
150
anytrans/include/alibabacloud/anytrans/AnyTransClient.h
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* 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_ANYTRANS_ANYTRANSCLIENT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_ANYTRANSCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RoaServiceClient.h>
|
||||
#include "AnyTransExport.h"
|
||||
#include "model/BatchTranslateRequest.h"
|
||||
#include "model/BatchTranslateResult.h"
|
||||
#include "model/BatchTranslateForHtmlRequest.h"
|
||||
#include "model/BatchTranslateForHtmlResult.h"
|
||||
#include "model/GetDocTranslateTaskRequest.h"
|
||||
#include "model/GetDocTranslateTaskResult.h"
|
||||
#include "model/GetHtmlTranslateTaskRequest.h"
|
||||
#include "model/GetHtmlTranslateTaskResult.h"
|
||||
#include "model/GetImageTranslateTaskRequest.h"
|
||||
#include "model/GetImageTranslateTaskResult.h"
|
||||
#include "model/GetLongTextTranslateTaskRequest.h"
|
||||
#include "model/GetLongTextTranslateTaskResult.h"
|
||||
#include "model/SubmitDocTranslateTaskRequest.h"
|
||||
#include "model/SubmitDocTranslateTaskResult.h"
|
||||
#include "model/SubmitHtmlTranslateTaskRequest.h"
|
||||
#include "model/SubmitHtmlTranslateTaskResult.h"
|
||||
#include "model/SubmitImageTranslateTaskRequest.h"
|
||||
#include "model/SubmitImageTranslateTaskResult.h"
|
||||
#include "model/SubmitLongTextTranslateTaskRequest.h"
|
||||
#include "model/SubmitLongTextTranslateTaskResult.h"
|
||||
#include "model/TermEditRequest.h"
|
||||
#include "model/TermEditResult.h"
|
||||
#include "model/TermQueryRequest.h"
|
||||
#include "model/TermQueryResult.h"
|
||||
#include "model/TextTranslateRequest.h"
|
||||
#include "model/TextTranslateResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT AnyTransClient : public RoaServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::BatchTranslateResult> BatchTranslateOutcome;
|
||||
typedef std::future<BatchTranslateOutcome> BatchTranslateOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::BatchTranslateRequest&, const BatchTranslateOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchTranslateAsyncHandler;
|
||||
typedef Outcome<Error, Model::BatchTranslateForHtmlResult> BatchTranslateForHtmlOutcome;
|
||||
typedef std::future<BatchTranslateForHtmlOutcome> BatchTranslateForHtmlOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::BatchTranslateForHtmlRequest&, const BatchTranslateForHtmlOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> BatchTranslateForHtmlAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetDocTranslateTaskResult> GetDocTranslateTaskOutcome;
|
||||
typedef std::future<GetDocTranslateTaskOutcome> GetDocTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::GetDocTranslateTaskRequest&, const GetDocTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetDocTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetHtmlTranslateTaskResult> GetHtmlTranslateTaskOutcome;
|
||||
typedef std::future<GetHtmlTranslateTaskOutcome> GetHtmlTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::GetHtmlTranslateTaskRequest&, const GetHtmlTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetHtmlTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetImageTranslateTaskResult> GetImageTranslateTaskOutcome;
|
||||
typedef std::future<GetImageTranslateTaskOutcome> GetImageTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::GetImageTranslateTaskRequest&, const GetImageTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetImageTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::GetLongTextTranslateTaskResult> GetLongTextTranslateTaskOutcome;
|
||||
typedef std::future<GetLongTextTranslateTaskOutcome> GetLongTextTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::GetLongTextTranslateTaskRequest&, const GetLongTextTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetLongTextTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::SubmitDocTranslateTaskResult> SubmitDocTranslateTaskOutcome;
|
||||
typedef std::future<SubmitDocTranslateTaskOutcome> SubmitDocTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::SubmitDocTranslateTaskRequest&, const SubmitDocTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SubmitDocTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::SubmitHtmlTranslateTaskResult> SubmitHtmlTranslateTaskOutcome;
|
||||
typedef std::future<SubmitHtmlTranslateTaskOutcome> SubmitHtmlTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::SubmitHtmlTranslateTaskRequest&, const SubmitHtmlTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SubmitHtmlTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::SubmitImageTranslateTaskResult> SubmitImageTranslateTaskOutcome;
|
||||
typedef std::future<SubmitImageTranslateTaskOutcome> SubmitImageTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::SubmitImageTranslateTaskRequest&, const SubmitImageTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SubmitImageTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::SubmitLongTextTranslateTaskResult> SubmitLongTextTranslateTaskOutcome;
|
||||
typedef std::future<SubmitLongTextTranslateTaskOutcome> SubmitLongTextTranslateTaskOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::SubmitLongTextTranslateTaskRequest&, const SubmitLongTextTranslateTaskOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> SubmitLongTextTranslateTaskAsyncHandler;
|
||||
typedef Outcome<Error, Model::TermEditResult> TermEditOutcome;
|
||||
typedef std::future<TermEditOutcome> TermEditOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::TermEditRequest&, const TermEditOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TermEditAsyncHandler;
|
||||
typedef Outcome<Error, Model::TermQueryResult> TermQueryOutcome;
|
||||
typedef std::future<TermQueryOutcome> TermQueryOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::TermQueryRequest&, const TermQueryOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TermQueryAsyncHandler;
|
||||
typedef Outcome<Error, Model::TextTranslateResult> TextTranslateOutcome;
|
||||
typedef std::future<TextTranslateOutcome> TextTranslateOutcomeCallable;
|
||||
typedef std::function<void(const AnyTransClient*, const Model::TextTranslateRequest&, const TextTranslateOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TextTranslateAsyncHandler;
|
||||
|
||||
AnyTransClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
AnyTransClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
AnyTransClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~AnyTransClient();
|
||||
BatchTranslateOutcome batchTranslate(const Model::BatchTranslateRequest &request)const;
|
||||
void batchTranslateAsync(const Model::BatchTranslateRequest& request, const BatchTranslateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
BatchTranslateOutcomeCallable batchTranslateCallable(const Model::BatchTranslateRequest& request) const;
|
||||
BatchTranslateForHtmlOutcome batchTranslateForHtml(const Model::BatchTranslateForHtmlRequest &request)const;
|
||||
void batchTranslateForHtmlAsync(const Model::BatchTranslateForHtmlRequest& request, const BatchTranslateForHtmlAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
BatchTranslateForHtmlOutcomeCallable batchTranslateForHtmlCallable(const Model::BatchTranslateForHtmlRequest& request) const;
|
||||
GetDocTranslateTaskOutcome getDocTranslateTask(const Model::GetDocTranslateTaskRequest &request)const;
|
||||
void getDocTranslateTaskAsync(const Model::GetDocTranslateTaskRequest& request, const GetDocTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetDocTranslateTaskOutcomeCallable getDocTranslateTaskCallable(const Model::GetDocTranslateTaskRequest& request) const;
|
||||
GetHtmlTranslateTaskOutcome getHtmlTranslateTask(const Model::GetHtmlTranslateTaskRequest &request)const;
|
||||
void getHtmlTranslateTaskAsync(const Model::GetHtmlTranslateTaskRequest& request, const GetHtmlTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetHtmlTranslateTaskOutcomeCallable getHtmlTranslateTaskCallable(const Model::GetHtmlTranslateTaskRequest& request) const;
|
||||
GetImageTranslateTaskOutcome getImageTranslateTask(const Model::GetImageTranslateTaskRequest &request)const;
|
||||
void getImageTranslateTaskAsync(const Model::GetImageTranslateTaskRequest& request, const GetImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetImageTranslateTaskOutcomeCallable getImageTranslateTaskCallable(const Model::GetImageTranslateTaskRequest& request) const;
|
||||
GetLongTextTranslateTaskOutcome getLongTextTranslateTask(const Model::GetLongTextTranslateTaskRequest &request)const;
|
||||
void getLongTextTranslateTaskAsync(const Model::GetLongTextTranslateTaskRequest& request, const GetLongTextTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
GetLongTextTranslateTaskOutcomeCallable getLongTextTranslateTaskCallable(const Model::GetLongTextTranslateTaskRequest& request) const;
|
||||
SubmitDocTranslateTaskOutcome submitDocTranslateTask(const Model::SubmitDocTranslateTaskRequest &request)const;
|
||||
void submitDocTranslateTaskAsync(const Model::SubmitDocTranslateTaskRequest& request, const SubmitDocTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SubmitDocTranslateTaskOutcomeCallable submitDocTranslateTaskCallable(const Model::SubmitDocTranslateTaskRequest& request) const;
|
||||
SubmitHtmlTranslateTaskOutcome submitHtmlTranslateTask(const Model::SubmitHtmlTranslateTaskRequest &request)const;
|
||||
void submitHtmlTranslateTaskAsync(const Model::SubmitHtmlTranslateTaskRequest& request, const SubmitHtmlTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SubmitHtmlTranslateTaskOutcomeCallable submitHtmlTranslateTaskCallable(const Model::SubmitHtmlTranslateTaskRequest& request) const;
|
||||
SubmitImageTranslateTaskOutcome submitImageTranslateTask(const Model::SubmitImageTranslateTaskRequest &request)const;
|
||||
void submitImageTranslateTaskAsync(const Model::SubmitImageTranslateTaskRequest& request, const SubmitImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SubmitImageTranslateTaskOutcomeCallable submitImageTranslateTaskCallable(const Model::SubmitImageTranslateTaskRequest& request) const;
|
||||
SubmitLongTextTranslateTaskOutcome submitLongTextTranslateTask(const Model::SubmitLongTextTranslateTaskRequest &request)const;
|
||||
void submitLongTextTranslateTaskAsync(const Model::SubmitLongTextTranslateTaskRequest& request, const SubmitLongTextTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
SubmitLongTextTranslateTaskOutcomeCallable submitLongTextTranslateTaskCallable(const Model::SubmitLongTextTranslateTaskRequest& request) const;
|
||||
TermEditOutcome termEdit(const Model::TermEditRequest &request)const;
|
||||
void termEditAsync(const Model::TermEditRequest& request, const TermEditAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TermEditOutcomeCallable termEditCallable(const Model::TermEditRequest& request) const;
|
||||
TermQueryOutcome termQuery(const Model::TermQueryRequest &request)const;
|
||||
void termQueryAsync(const Model::TermQueryRequest& request, const TermQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TermQueryOutcomeCallable termQueryCallable(const Model::TermQueryRequest& request) const;
|
||||
TextTranslateOutcome textTranslate(const Model::TextTranslateRequest &request)const;
|
||||
void textTranslateAsync(const Model::TextTranslateRequest& request, const TextTranslateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TextTranslateOutcomeCallable textTranslateCallable(const Model::TextTranslateRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_ANYTRANSCLIENT_H_
|
||||
32
anytrans/include/alibabacloud/anytrans/AnyTransExport.h
Normal file
32
anytrans/include/alibabacloud/anytrans/AnyTransExport.h
Normal file
@@ -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_ANYTRANS_ANYTRANSEXPORT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_ANYTRANSEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_ANYTRANS_LIBRARY)
|
||||
# define ALIBABACLOUD_ANYTRANS_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_ANYTRANS_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_ANYTRANS_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_ANYTRANSEXPORT_H_
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_BATCHTRANSLATEFORHTMLREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATEFORHTMLREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT BatchTranslateForHtmlRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
std::string string;
|
||||
std::vector<std::string> sensitives;
|
||||
struct TerminologiesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
terminologiesItem terminologiesItem;
|
||||
std::vector<terminologiesItem> terminologies;
|
||||
struct TextTransform {
|
||||
bool toLower;
|
||||
bool toUpper;
|
||||
bool toTitle;
|
||||
};
|
||||
textTransform textTransform;
|
||||
struct ExamplesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
examplesItem examplesItem;
|
||||
std::vector<examplesItem> examples;
|
||||
struct Config {
|
||||
bool skipCsiCheck;
|
||||
};
|
||||
config config;
|
||||
std::string domainHint;
|
||||
};
|
||||
BatchTranslateForHtmlRequest();
|
||||
~BatchTranslateForHtmlRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getFormat() const;
|
||||
void setFormat(const std::string &format);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getAppName() const;
|
||||
void setAppName(const std::string &appName);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::map<std::string, std::string> getText() const;
|
||||
void setText(const std::map<std::string, std::string> &text);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string format_;
|
||||
std::string scene_;
|
||||
std::string appName_;
|
||||
std::string targetLanguage_;
|
||||
std::map<std::string, std::string> text_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATEFORHTMLREQUEST_H_
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_BATCHTRANSLATEFORHTMLRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATEFORHTMLRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT BatchTranslateForHtmlResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct TranslationListItem
|
||||
{
|
||||
struct Usage
|
||||
{
|
||||
long inputTokens;
|
||||
long totalTokens;
|
||||
long outputTokens;
|
||||
};
|
||||
Usage usage;
|
||||
std::string translation;
|
||||
std::string message;
|
||||
std::string index;
|
||||
long code;
|
||||
};
|
||||
std::vector<TranslationListItem> translationList;
|
||||
};
|
||||
|
||||
|
||||
BatchTranslateForHtmlResult();
|
||||
explicit BatchTranslateForHtmlResult(const std::string &payload);
|
||||
~BatchTranslateForHtmlResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATEFORHTMLRESULT_H_
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_BATCHTRANSLATEREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATEREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT BatchTranslateRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
std::string string;
|
||||
std::vector<std::string> sensitives;
|
||||
struct TerminologiesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
terminologiesItem terminologiesItem;
|
||||
std::vector<terminologiesItem> terminologies;
|
||||
struct TextTransform {
|
||||
bool toLower;
|
||||
bool toUpper;
|
||||
bool toTitle;
|
||||
};
|
||||
textTransform textTransform;
|
||||
struct ExamplesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
examplesItem examplesItem;
|
||||
std::vector<examplesItem> examples;
|
||||
struct Config {
|
||||
bool skipCsiCheck;
|
||||
};
|
||||
config config;
|
||||
std::string domainHint;
|
||||
};
|
||||
BatchTranslateRequest();
|
||||
~BatchTranslateRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getFormat() const;
|
||||
void setFormat(const std::string &format);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getAppName() const;
|
||||
void setAppName(const std::string &appName);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::map<std::string, std::string> getText() const;
|
||||
void setText(const std::map<std::string, std::string> &text);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string format_;
|
||||
std::string scene_;
|
||||
std::string appName_;
|
||||
std::string targetLanguage_;
|
||||
std::map<std::string, std::string> text_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATEREQUEST_H_
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_BATCHTRANSLATERESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT BatchTranslateResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct TranslationListItem
|
||||
{
|
||||
struct Usage
|
||||
{
|
||||
long inputTokens;
|
||||
long totalTokens;
|
||||
long outputTokens;
|
||||
};
|
||||
Usage usage;
|
||||
std::string translation;
|
||||
std::string message;
|
||||
std::string index;
|
||||
long code;
|
||||
};
|
||||
std::vector<TranslationListItem> translationList;
|
||||
};
|
||||
|
||||
|
||||
BatchTranslateResult();
|
||||
explicit BatchTranslateResult(const std::string &payload);
|
||||
~BatchTranslateResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_BATCHTRANSLATERESULT_H_
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_GETDOCTRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETDOCTRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetDocTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
GetDocTranslateTaskRequest();
|
||||
~GetDocTranslateTaskRequest();
|
||||
std::string getTaskId() const;
|
||||
void setTaskId(const std::string &taskId);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
std::string taskId_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETDOCTRANSLATETASKREQUEST_H_
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_GETDOCTRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETDOCTRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetDocTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string status;
|
||||
int charactersCount;
|
||||
std::string taskId;
|
||||
int pageCount;
|
||||
std::string translateFileUrl;
|
||||
};
|
||||
|
||||
|
||||
GetDocTranslateTaskResult();
|
||||
explicit GetDocTranslateTaskResult(const std::string &payload);
|
||||
~GetDocTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETDOCTRANSLATETASKRESULT_H_
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_GETHTMLTRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETHTMLTRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetHtmlTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
GetHtmlTranslateTaskRequest();
|
||||
~GetHtmlTranslateTaskRequest();
|
||||
std::string getTaskId() const;
|
||||
void setTaskId(const std::string &taskId);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
std::string taskId_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETHTMLTRANSLATETASKREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_GETHTMLTRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETHTMLTRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetHtmlTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Usage
|
||||
{
|
||||
long inputTokens;
|
||||
long totalTokens;
|
||||
long outputTokens;
|
||||
};
|
||||
Usage usage;
|
||||
std::string translation;
|
||||
};
|
||||
|
||||
|
||||
GetHtmlTranslateTaskResult();
|
||||
explicit GetHtmlTranslateTaskResult(const std::string &payload);
|
||||
~GetHtmlTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETHTMLTRANSLATETASKRESULT_H_
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_GETIMAGETRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETIMAGETRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetImageTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
GetImageTranslateTaskRequest();
|
||||
~GetImageTranslateTaskRequest();
|
||||
std::string getTaskId() const;
|
||||
void setTaskId(const std::string &taskId);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
std::string taskId_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETIMAGETRANSLATETASKREQUEST_H_
|
||||
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_GETIMAGETRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETIMAGETRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetImageTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Translation
|
||||
{
|
||||
struct BoundingBoxesItem
|
||||
{
|
||||
struct UpLeft
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
struct UpRight
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
struct DownLeft
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
struct DownRight
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
long tableId;
|
||||
long tableCellId;
|
||||
std::string translation;
|
||||
UpRight upRight;
|
||||
DownRight downRight;
|
||||
float confidence;
|
||||
UpLeft upLeft;
|
||||
std::string text;
|
||||
long direction;
|
||||
DownLeft downLeft;
|
||||
};
|
||||
struct TableInfosItem
|
||||
{
|
||||
struct CellInfosItem
|
||||
{
|
||||
struct PosItem
|
||||
{
|
||||
long x;
|
||||
long y;
|
||||
};
|
||||
long tableCellId;
|
||||
std::vector<CellInfosItem::PosItem> pos;
|
||||
long yec;
|
||||
long xec;
|
||||
long ysc;
|
||||
long xsc;
|
||||
std::string text;
|
||||
};
|
||||
long tableId;
|
||||
std::vector<TableInfosItem::CellInfosItem> cellInfos;
|
||||
long xCellSize;
|
||||
long yCellSize;
|
||||
};
|
||||
long orgWidth;
|
||||
std::vector<BoundingBoxesItem> boundingBoxes;
|
||||
long angle;
|
||||
long orgHeight;
|
||||
long boxesCount;
|
||||
long height;
|
||||
std::vector<TableInfosItem> tableInfos;
|
||||
long width;
|
||||
};
|
||||
Translation translation;
|
||||
std::string traceId;
|
||||
};
|
||||
|
||||
|
||||
GetImageTranslateTaskResult();
|
||||
explicit GetImageTranslateTaskResult(const std::string &payload);
|
||||
~GetImageTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
bool getSynchro()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
bool synchro_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETIMAGETRANSLATETASKRESULT_H_
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_GETLONGTEXTTRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETLONGTEXTTRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetLongTextTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
GetLongTextTranslateTaskRequest();
|
||||
~GetLongTextTranslateTaskRequest();
|
||||
std::string getTaskId() const;
|
||||
void setTaskId(const std::string &taskId);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
std::string taskId_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETLONGTEXTTRANSLATETASKREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_GETLONGTEXTTRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_GETLONGTEXTTRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT GetLongTextTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Usage
|
||||
{
|
||||
long inputTokens;
|
||||
long totalTokens;
|
||||
long outputTokens;
|
||||
};
|
||||
Usage usage;
|
||||
std::string translation;
|
||||
};
|
||||
|
||||
|
||||
GetLongTextTranslateTaskResult();
|
||||
explicit GetLongTextTranslateTaskResult(const std::string &payload);
|
||||
~GetLongTextTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_GETLONGTEXTTRANSLATETASKRESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_SUBMITDOCTRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITDOCTRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitDocTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
struct TerminologiesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
terminologiesItem terminologiesItem;
|
||||
std::vector<terminologiesItem> terminologies;
|
||||
struct Config {
|
||||
bool skipImgTrans;
|
||||
};
|
||||
config config;
|
||||
std::string domainHint;
|
||||
};
|
||||
SubmitDocTranslateTaskRequest();
|
||||
~SubmitDocTranslateTaskRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getFormat() const;
|
||||
void setFormat(const std::string &format);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::string getText() const;
|
||||
void setText(const std::string &text);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string format_;
|
||||
std::string scene_;
|
||||
std::string targetLanguage_;
|
||||
std::string text_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITDOCTRANSLATETASKREQUEST_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_ANYTRANS_MODEL_SUBMITDOCTRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITDOCTRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitDocTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string status;
|
||||
std::string taskId;
|
||||
};
|
||||
|
||||
|
||||
SubmitDocTranslateTaskResult();
|
||||
explicit SubmitDocTranslateTaskResult(const std::string &payload);
|
||||
~SubmitDocTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITDOCTRANSLATETASKRESULT_H_
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_SUBMITHTMLTRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITHTMLTRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitHtmlTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
std::string string;
|
||||
std::vector<std::string> sensitives;
|
||||
struct TerminologiesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
terminologiesItem terminologiesItem;
|
||||
std::vector<terminologiesItem> terminologies;
|
||||
struct TextTransform {
|
||||
bool toLower;
|
||||
bool toUpper;
|
||||
bool toTitle;
|
||||
};
|
||||
textTransform textTransform;
|
||||
struct ExamplesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
examplesItem examplesItem;
|
||||
std::vector<examplesItem> examples;
|
||||
struct Config {
|
||||
bool skipCsiCheck;
|
||||
std::string callbackUrl;
|
||||
};
|
||||
config config;
|
||||
std::string domainHint;
|
||||
};
|
||||
SubmitHtmlTranslateTaskRequest();
|
||||
~SubmitHtmlTranslateTaskRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getFormat() const;
|
||||
void setFormat(const std::string &format);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::string getText() const;
|
||||
void setText(const std::string &text);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string format_;
|
||||
std::string scene_;
|
||||
std::string targetLanguage_;
|
||||
std::string text_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITHTMLTRANSLATETASKREQUEST_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_ANYTRANS_MODEL_SUBMITHTMLTRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITHTMLTRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitHtmlTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string status;
|
||||
std::string taskId;
|
||||
};
|
||||
|
||||
|
||||
SubmitHtmlTranslateTaskResult();
|
||||
explicit SubmitHtmlTranslateTaskResult(const std::string &payload);
|
||||
~SubmitHtmlTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITHTMLTRANSLATETASKRESULT_H_
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_SUBMITIMAGETRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITIMAGETRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitImageTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
std::string string;
|
||||
std::vector<std::string> sensitives;
|
||||
struct TerminologiesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
terminologiesItem terminologiesItem;
|
||||
std::vector<terminologiesItem> terminologies;
|
||||
struct TextTransform {
|
||||
bool toLower;
|
||||
bool toUpper;
|
||||
bool toTitle;
|
||||
};
|
||||
textTransform textTransform;
|
||||
struct ExamplesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
examplesItem examplesItem;
|
||||
std::vector<examplesItem> examples;
|
||||
std::string domainHint;
|
||||
};
|
||||
SubmitImageTranslateTaskRequest();
|
||||
~SubmitImageTranslateTaskRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getFormat() const;
|
||||
void setFormat(const std::string &format);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getText() const;
|
||||
void setText(const std::string &text);
|
||||
std::vector<std::string> getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::vector<std::string> &targetLanguage);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string format_;
|
||||
std::string scene_;
|
||||
std::string text_;
|
||||
std::vector<std::string> targetLanguage_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITIMAGETRANSLATETASKREQUEST_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_ANYTRANS_MODEL_SUBMITIMAGETRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITIMAGETRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitImageTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string status;
|
||||
std::string taskId;
|
||||
};
|
||||
|
||||
|
||||
SubmitImageTranslateTaskResult();
|
||||
explicit SubmitImageTranslateTaskResult(const std::string &payload);
|
||||
~SubmitImageTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITIMAGETRANSLATETASKRESULT_H_
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_SUBMITLONGTEXTTRANSLATETASKREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITLONGTEXTTRANSLATETASKREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitLongTextTranslateTaskRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
std::string string;
|
||||
std::vector<std::string> sensitives;
|
||||
struct TerminologiesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
terminologiesItem terminologiesItem;
|
||||
std::vector<terminologiesItem> terminologies;
|
||||
struct TextTransform {
|
||||
bool toLower;
|
||||
bool toUpper;
|
||||
bool toTitle;
|
||||
};
|
||||
textTransform textTransform;
|
||||
struct ExamplesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
examplesItem examplesItem;
|
||||
std::vector<examplesItem> examples;
|
||||
struct Config {
|
||||
bool skipCsiCheck;
|
||||
};
|
||||
config config;
|
||||
std::string domainHint;
|
||||
};
|
||||
SubmitLongTextTranslateTaskRequest();
|
||||
~SubmitLongTextTranslateTaskRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getFormat() const;
|
||||
void setFormat(const std::string &format);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::string getText() const;
|
||||
void setText(const std::string &text);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string format_;
|
||||
std::string scene_;
|
||||
std::string targetLanguage_;
|
||||
std::string text_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITLONGTEXTTRANSLATETASKREQUEST_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_ANYTRANS_MODEL_SUBMITLONGTEXTTRANSLATETASKRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_SUBMITLONGTEXTTRANSLATETASKRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT SubmitLongTextTranslateTaskResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::string status;
|
||||
std::string taskId;
|
||||
};
|
||||
|
||||
|
||||
SubmitLongTextTranslateTaskResult();
|
||||
explicit SubmitLongTextTranslateTaskResult(const std::string &payload);
|
||||
~SubmitLongTextTranslateTaskResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_SUBMITLONGTEXTTRANSLATETASKRESULT_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_ANYTRANS_MODEL_TERMEDITREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_TERMEDITREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT TermEditRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
struct TermsItem {
|
||||
std::string tgt;
|
||||
std::string termId;
|
||||
std::string src;
|
||||
};
|
||||
termsItem termsItem;
|
||||
std::vector<termsItem> terms;
|
||||
};
|
||||
TermEditRequest();
|
||||
~TermEditRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getAction() const;
|
||||
void setAction(const std::string &action);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string scene_;
|
||||
std::string action_;
|
||||
std::string targetLanguage_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_TERMEDITREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_TERMEDITRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_TERMEDITRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT TermEditResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct TermsItem
|
||||
{
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
std::string termId;
|
||||
};
|
||||
std::vector<TermsItem> terms;
|
||||
long failCount;
|
||||
};
|
||||
|
||||
|
||||
TermEditResult();
|
||||
explicit TermEditResult(const std::string &payload);
|
||||
~TermEditResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_TERMEDITRESULT_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_ANYTRANS_MODEL_TERMQUERYREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_TERMQUERYREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT TermQueryRequest : public RoaServiceRequest {
|
||||
public:
|
||||
TermQueryRequest();
|
||||
~TermQueryRequest();
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::string getText() const;
|
||||
void setText(const std::string &text);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
std::string sourceLanguage_;
|
||||
std::string scene_;
|
||||
std::string targetLanguage_;
|
||||
std::string text_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_TERMQUERYREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_TERMQUERYRESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_TERMQUERYRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT TermQueryResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct TermsItem
|
||||
{
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
std::string termId;
|
||||
};
|
||||
std::vector<TermsItem> terms;
|
||||
long failCount;
|
||||
};
|
||||
|
||||
|
||||
TermQueryResult();
|
||||
explicit TermQueryResult(const std::string &payload);
|
||||
~TermQueryResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_TERMQUERYRESULT_H_
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* 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_ANYTRANS_MODEL_TEXTTRANSLATEREQUEST_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_TEXTTRANSLATEREQUEST_H_
|
||||
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
#include <alibabacloud/core/RoaServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace AnyTrans {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT TextTranslateRequest : public RoaServiceRequest {
|
||||
public:
|
||||
struct Ext {
|
||||
std::string string;
|
||||
std::vector<std::string> sensitives;
|
||||
struct TerminologiesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
terminologiesItem terminologiesItem;
|
||||
std::vector<terminologiesItem> terminologies;
|
||||
struct TextTransform {
|
||||
bool toLower;
|
||||
bool toUpper;
|
||||
bool toTitle;
|
||||
};
|
||||
textTransform textTransform;
|
||||
std::string agent;
|
||||
struct ExamplesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
examplesItem examplesItem;
|
||||
std::vector<examplesItem> examples;
|
||||
struct Config {
|
||||
bool skipCsiCheck;
|
||||
};
|
||||
config config;
|
||||
std::string domainHint;
|
||||
};
|
||||
TextTranslateRequest();
|
||||
~TextTranslateRequest();
|
||||
ext getExt() const;
|
||||
void setExt(const ext &ext);
|
||||
std::string getSourceLanguage() const;
|
||||
void setSourceLanguage(const std::string &sourceLanguage);
|
||||
std::string getFormat() const;
|
||||
void setFormat(const std::string &format);
|
||||
std::string getScene() const;
|
||||
void setScene(const std::string &scene);
|
||||
std::string getTargetLanguage() const;
|
||||
void setTargetLanguage(const std::string &targetLanguage);
|
||||
std::string getText() const;
|
||||
void setText(const std::string &text);
|
||||
std::string getWorkspaceId() const;
|
||||
void setWorkspaceId(const std::string &workspaceId);
|
||||
|
||||
private:
|
||||
ext ext_;
|
||||
std::string sourceLanguage_;
|
||||
std::string format_;
|
||||
std::string scene_;
|
||||
std::string targetLanguage_;
|
||||
std::string text_;
|
||||
std::string workspaceId_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace AnyTrans
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_TEXTTRANSLATEREQUEST_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_ANYTRANS_MODEL_TEXTTRANSLATERESULT_H_
|
||||
#define ALIBABACLOUD_ANYTRANS_MODEL_TEXTTRANSLATERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/anytrans/AnyTransExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace AnyTrans
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_ANYTRANS_EXPORT TextTranslateResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Usage
|
||||
{
|
||||
long inputTokens;
|
||||
long totalTokens;
|
||||
long outputTokens;
|
||||
};
|
||||
Usage usage;
|
||||
std::string translation;
|
||||
};
|
||||
|
||||
|
||||
TextTranslateResult();
|
||||
explicit TextTranslateResult(const std::string &payload);
|
||||
~TextTranslateResult();
|
||||
std::string getMessage()const;
|
||||
std::string getRequestId()const;
|
||||
std::string getHttpStatusCode()const;
|
||||
Data getData()const;
|
||||
std::string getCode()const;
|
||||
bool getSuccess()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
std::string message_;
|
||||
std::string requestId_;
|
||||
std::string httpStatusCode_;
|
||||
Data data_;
|
||||
std::string code_;
|
||||
bool success_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_ANYTRANS_MODEL_TEXTTRANSLATERESULT_H_
|
||||
521
anytrans/src/AnyTransClient.cc
Normal file
521
anytrans/src/AnyTransClient.cc
Normal file
@@ -0,0 +1,521 @@
|
||||
/*
|
||||
* 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/anytrans/AnyTransClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "AnyTrans";
|
||||
}
|
||||
|
||||
AnyTransClient::AnyTransClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RoaServiceClient(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, "");
|
||||
}
|
||||
|
||||
AnyTransClient::AnyTransClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "");
|
||||
}
|
||||
|
||||
AnyTransClient::AnyTransClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RoaServiceClient(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, "");
|
||||
}
|
||||
|
||||
AnyTransClient::~AnyTransClient()
|
||||
{}
|
||||
|
||||
AnyTransClient::BatchTranslateOutcome AnyTransClient::batchTranslate(const BatchTranslateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return BatchTranslateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return BatchTranslateOutcome(BatchTranslateResult(outcome.result()));
|
||||
else
|
||||
return BatchTranslateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::batchTranslateAsync(const BatchTranslateRequest& request, const BatchTranslateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, batchTranslate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::BatchTranslateOutcomeCallable AnyTransClient::batchTranslateCallable(const BatchTranslateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<BatchTranslateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->batchTranslate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::BatchTranslateForHtmlOutcome AnyTransClient::batchTranslateForHtml(const BatchTranslateForHtmlRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return BatchTranslateForHtmlOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return BatchTranslateForHtmlOutcome(BatchTranslateForHtmlResult(outcome.result()));
|
||||
else
|
||||
return BatchTranslateForHtmlOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::batchTranslateForHtmlAsync(const BatchTranslateForHtmlRequest& request, const BatchTranslateForHtmlAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, batchTranslateForHtml(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::BatchTranslateForHtmlOutcomeCallable AnyTransClient::batchTranslateForHtmlCallable(const BatchTranslateForHtmlRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<BatchTranslateForHtmlOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->batchTranslateForHtml(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::GetDocTranslateTaskOutcome AnyTransClient::getDocTranslateTask(const GetDocTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetDocTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetDocTranslateTaskOutcome(GetDocTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return GetDocTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::getDocTranslateTaskAsync(const GetDocTranslateTaskRequest& request, const GetDocTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getDocTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::GetDocTranslateTaskOutcomeCallable AnyTransClient::getDocTranslateTaskCallable(const GetDocTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetDocTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getDocTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::GetHtmlTranslateTaskOutcome AnyTransClient::getHtmlTranslateTask(const GetHtmlTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetHtmlTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetHtmlTranslateTaskOutcome(GetHtmlTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return GetHtmlTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::getHtmlTranslateTaskAsync(const GetHtmlTranslateTaskRequest& request, const GetHtmlTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getHtmlTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::GetHtmlTranslateTaskOutcomeCallable AnyTransClient::getHtmlTranslateTaskCallable(const GetHtmlTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetHtmlTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getHtmlTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::GetImageTranslateTaskOutcome AnyTransClient::getImageTranslateTask(const GetImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetImageTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetImageTranslateTaskOutcome(GetImageTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return GetImageTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::getImageTranslateTaskAsync(const GetImageTranslateTaskRequest& request, const GetImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getImageTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::GetImageTranslateTaskOutcomeCallable AnyTransClient::getImageTranslateTaskCallable(const GetImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetImageTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getImageTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::GetLongTextTranslateTaskOutcome AnyTransClient::getLongTextTranslateTask(const GetLongTextTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetLongTextTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetLongTextTranslateTaskOutcome(GetLongTextTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return GetLongTextTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::getLongTextTranslateTaskAsync(const GetLongTextTranslateTaskRequest& request, const GetLongTextTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getLongTextTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::GetLongTextTranslateTaskOutcomeCallable AnyTransClient::getLongTextTranslateTaskCallable(const GetLongTextTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetLongTextTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getLongTextTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitDocTranslateTaskOutcome AnyTransClient::submitDocTranslateTask(const SubmitDocTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SubmitDocTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SubmitDocTranslateTaskOutcome(SubmitDocTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return SubmitDocTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::submitDocTranslateTaskAsync(const SubmitDocTranslateTaskRequest& request, const SubmitDocTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, submitDocTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitDocTranslateTaskOutcomeCallable AnyTransClient::submitDocTranslateTaskCallable(const SubmitDocTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SubmitDocTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->submitDocTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitHtmlTranslateTaskOutcome AnyTransClient::submitHtmlTranslateTask(const SubmitHtmlTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SubmitHtmlTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SubmitHtmlTranslateTaskOutcome(SubmitHtmlTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return SubmitHtmlTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::submitHtmlTranslateTaskAsync(const SubmitHtmlTranslateTaskRequest& request, const SubmitHtmlTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, submitHtmlTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitHtmlTranslateTaskOutcomeCallable AnyTransClient::submitHtmlTranslateTaskCallable(const SubmitHtmlTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SubmitHtmlTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->submitHtmlTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitImageTranslateTaskOutcome AnyTransClient::submitImageTranslateTask(const SubmitImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SubmitImageTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SubmitImageTranslateTaskOutcome(SubmitImageTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return SubmitImageTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::submitImageTranslateTaskAsync(const SubmitImageTranslateTaskRequest& request, const SubmitImageTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, submitImageTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitImageTranslateTaskOutcomeCallable AnyTransClient::submitImageTranslateTaskCallable(const SubmitImageTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SubmitImageTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->submitImageTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitLongTextTranslateTaskOutcome AnyTransClient::submitLongTextTranslateTask(const SubmitLongTextTranslateTaskRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return SubmitLongTextTranslateTaskOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return SubmitLongTextTranslateTaskOutcome(SubmitLongTextTranslateTaskResult(outcome.result()));
|
||||
else
|
||||
return SubmitLongTextTranslateTaskOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::submitLongTextTranslateTaskAsync(const SubmitLongTextTranslateTaskRequest& request, const SubmitLongTextTranslateTaskAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, submitLongTextTranslateTask(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::SubmitLongTextTranslateTaskOutcomeCallable AnyTransClient::submitLongTextTranslateTaskCallable(const SubmitLongTextTranslateTaskRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<SubmitLongTextTranslateTaskOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->submitLongTextTranslateTask(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::TermEditOutcome AnyTransClient::termEdit(const TermEditRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return TermEditOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return TermEditOutcome(TermEditResult(outcome.result()));
|
||||
else
|
||||
return TermEditOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::termEditAsync(const TermEditRequest& request, const TermEditAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, termEdit(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::TermEditOutcomeCallable AnyTransClient::termEditCallable(const TermEditRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<TermEditOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->termEdit(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::TermQueryOutcome AnyTransClient::termQuery(const TermQueryRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return TermQueryOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return TermQueryOutcome(TermQueryResult(outcome.result()));
|
||||
else
|
||||
return TermQueryOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::termQueryAsync(const TermQueryRequest& request, const TermQueryAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, termQuery(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::TermQueryOutcomeCallable AnyTransClient::termQueryCallable(const TermQueryRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<TermQueryOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->termQuery(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
AnyTransClient::TextTranslateOutcome AnyTransClient::textTranslate(const TextTranslateRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return TextTranslateOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return TextTranslateOutcome(TextTranslateResult(outcome.result()));
|
||||
else
|
||||
return TextTranslateOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void AnyTransClient::textTranslateAsync(const TextTranslateRequest& request, const TextTranslateAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, textTranslate(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
AnyTransClient::TextTranslateOutcomeCallable AnyTransClient::textTranslateCallable(const TextTranslateRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<TextTranslateOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->textTranslate(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
117
anytrans/src/model/BatchTranslateForHtmlRequest.cc
Normal file
117
anytrans/src/model/BatchTranslateForHtmlRequest.cc
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* 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/anytrans/model/BatchTranslateForHtmlRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::BatchTranslateForHtmlRequest;
|
||||
|
||||
BatchTranslateForHtmlRequest::BatchTranslateForHtmlRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/batchForHtml"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
BatchTranslateForHtmlRequest::~BatchTranslateForHtmlRequest() {}
|
||||
|
||||
BatchTranslateForHtmlRequest::ext BatchTranslateForHtmlRequest::getExt() const {
|
||||
return ext_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setExt(const BatchTranslateForHtmlRequest::ext &ext) {
|
||||
ext_ = ext;
|
||||
for(int dep1 = 0; dep1 != ext.sensitives.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".sensitives." + std::to_string(dep1 + 1), ext.sensitives[dep1]);
|
||||
}
|
||||
for(int dep1 = 0; dep1 != ext.terminologies.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".tgt", ext.terminologies[dep1].tgt);
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".src", ext.terminologies[dep1].src);
|
||||
}
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toLower", ext.textTransform.toLower ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toUpper", ext.textTransform.toUpper ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toTitle", ext.textTransform.toTitle ? "true" : "false");
|
||||
for(int dep1 = 0; dep1 != ext.examples.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".examples." + std::to_string(dep1 + 1) + ".tgt", ext.examples[dep1].tgt);
|
||||
setBodyParameter(std::string("ext") + ".examples." + std::to_string(dep1 + 1) + ".src", ext.examples[dep1].src);
|
||||
}
|
||||
setBodyParameter(std::string("ext") + ".config.skipCsiCheck", ext.config.skipCsiCheck ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".domainHint", ext.domainHint);
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlRequest::getSourceLanguage() const {
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setSourceLanguage(const std::string &sourceLanguage) {
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter(std::string("sourceLanguage"), sourceLanguage);
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlRequest::getFormat() const {
|
||||
return format_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setFormat(const std::string &format) {
|
||||
format_ = format;
|
||||
setBodyParameter(std::string("format"), format);
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlRequest::getScene() const {
|
||||
return scene_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setScene(const std::string &scene) {
|
||||
scene_ = scene;
|
||||
setBodyParameter(std::string("scene"), scene);
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setBodyParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlRequest::getTargetLanguage() const {
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setTargetLanguage(const std::string &targetLanguage) {
|
||||
targetLanguage_ = targetLanguage;
|
||||
setBodyParameter(std::string("targetLanguage"), targetLanguage);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> BatchTranslateForHtmlRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setText(const std::map<std::string, std::string> &text) {
|
||||
text_ = text;
|
||||
for(auto const &iter1 : text) {
|
||||
setBodyParameter(std::string("text") + "." + iter1.first, iter1.second);
|
||||
}
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void BatchTranslateForHtmlRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
106
anytrans/src/model/BatchTranslateForHtmlResult.cc
Normal file
106
anytrans/src/model/BatchTranslateForHtmlResult.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/anytrans/model/BatchTranslateForHtmlResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
BatchTranslateForHtmlResult::BatchTranslateForHtmlResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
BatchTranslateForHtmlResult::BatchTranslateForHtmlResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
BatchTranslateForHtmlResult::~BatchTranslateForHtmlResult()
|
||||
{}
|
||||
|
||||
void BatchTranslateForHtmlResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
auto alltranslationListNode = dataNode["translationList"]["translationListItem"];
|
||||
for (auto dataNodetranslationListtranslationListItem : alltranslationListNode)
|
||||
{
|
||||
Data::TranslationListItem translationListItemObject;
|
||||
if(!dataNodetranslationListtranslationListItem["code"].isNull())
|
||||
translationListItemObject.code = std::stol(dataNodetranslationListtranslationListItem["code"].asString());
|
||||
if(!dataNodetranslationListtranslationListItem["message"].isNull())
|
||||
translationListItemObject.message = dataNodetranslationListtranslationListItem["message"].asString();
|
||||
if(!dataNodetranslationListtranslationListItem["index"].isNull())
|
||||
translationListItemObject.index = dataNodetranslationListtranslationListItem["index"].asString();
|
||||
if(!dataNodetranslationListtranslationListItem["translation"].isNull())
|
||||
translationListItemObject.translation = dataNodetranslationListtranslationListItem["translation"].asString();
|
||||
auto usageNode = value["usage"];
|
||||
if(!usageNode["inputTokens"].isNull())
|
||||
translationListItemObject.usage.inputTokens = std::stol(usageNode["inputTokens"].asString());
|
||||
if(!usageNode["outputTokens"].isNull())
|
||||
translationListItemObject.usage.outputTokens = std::stol(usageNode["outputTokens"].asString());
|
||||
if(!usageNode["totalTokens"].isNull())
|
||||
translationListItemObject.usage.totalTokens = std::stol(usageNode["totalTokens"].asString());
|
||||
data_.translationList.push_back(translationListItemObject);
|
||||
}
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
BatchTranslateForHtmlResult::Data BatchTranslateForHtmlResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string BatchTranslateForHtmlResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool BatchTranslateForHtmlResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
117
anytrans/src/model/BatchTranslateRequest.cc
Normal file
117
anytrans/src/model/BatchTranslateRequest.cc
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* 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/anytrans/model/BatchTranslateRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::BatchTranslateRequest;
|
||||
|
||||
BatchTranslateRequest::BatchTranslateRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/batch"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
BatchTranslateRequest::~BatchTranslateRequest() {}
|
||||
|
||||
BatchTranslateRequest::ext BatchTranslateRequest::getExt() const {
|
||||
return ext_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setExt(const BatchTranslateRequest::ext &ext) {
|
||||
ext_ = ext;
|
||||
for(int dep1 = 0; dep1 != ext.sensitives.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".sensitives." + std::to_string(dep1 + 1), ext.sensitives[dep1]);
|
||||
}
|
||||
for(int dep1 = 0; dep1 != ext.terminologies.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".tgt", ext.terminologies[dep1].tgt);
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".src", ext.terminologies[dep1].src);
|
||||
}
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toLower", ext.textTransform.toLower ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toUpper", ext.textTransform.toUpper ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toTitle", ext.textTransform.toTitle ? "true" : "false");
|
||||
for(int dep1 = 0; dep1 != ext.examples.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".examples." + std::to_string(dep1 + 1) + ".tgt", ext.examples[dep1].tgt);
|
||||
setBodyParameter(std::string("ext") + ".examples." + std::to_string(dep1 + 1) + ".src", ext.examples[dep1].src);
|
||||
}
|
||||
setBodyParameter(std::string("ext") + ".config.skipCsiCheck", ext.config.skipCsiCheck ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".domainHint", ext.domainHint);
|
||||
}
|
||||
|
||||
std::string BatchTranslateRequest::getSourceLanguage() const {
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setSourceLanguage(const std::string &sourceLanguage) {
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter(std::string("sourceLanguage"), sourceLanguage);
|
||||
}
|
||||
|
||||
std::string BatchTranslateRequest::getFormat() const {
|
||||
return format_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setFormat(const std::string &format) {
|
||||
format_ = format;
|
||||
setBodyParameter(std::string("format"), format);
|
||||
}
|
||||
|
||||
std::string BatchTranslateRequest::getScene() const {
|
||||
return scene_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setScene(const std::string &scene) {
|
||||
scene_ = scene;
|
||||
setBodyParameter(std::string("scene"), scene);
|
||||
}
|
||||
|
||||
std::string BatchTranslateRequest::getAppName() const {
|
||||
return appName_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setAppName(const std::string &appName) {
|
||||
appName_ = appName;
|
||||
setBodyParameter(std::string("appName"), appName);
|
||||
}
|
||||
|
||||
std::string BatchTranslateRequest::getTargetLanguage() const {
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setTargetLanguage(const std::string &targetLanguage) {
|
||||
targetLanguage_ = targetLanguage;
|
||||
setBodyParameter(std::string("targetLanguage"), targetLanguage);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string> BatchTranslateRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setText(const std::map<std::string, std::string> &text) {
|
||||
text_ = text;
|
||||
for(auto const &iter1 : text) {
|
||||
setBodyParameter(std::string("text") + "." + iter1.first, iter1.second);
|
||||
}
|
||||
}
|
||||
|
||||
std::string BatchTranslateRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void BatchTranslateRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
106
anytrans/src/model/BatchTranslateResult.cc
Normal file
106
anytrans/src/model/BatchTranslateResult.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/anytrans/model/BatchTranslateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
BatchTranslateResult::BatchTranslateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
BatchTranslateResult::BatchTranslateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
BatchTranslateResult::~BatchTranslateResult()
|
||||
{}
|
||||
|
||||
void BatchTranslateResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
auto alltranslationListNode = dataNode["translationList"]["translationListItem"];
|
||||
for (auto dataNodetranslationListtranslationListItem : alltranslationListNode)
|
||||
{
|
||||
Data::TranslationListItem translationListItemObject;
|
||||
if(!dataNodetranslationListtranslationListItem["code"].isNull())
|
||||
translationListItemObject.code = std::stol(dataNodetranslationListtranslationListItem["code"].asString());
|
||||
if(!dataNodetranslationListtranslationListItem["message"].isNull())
|
||||
translationListItemObject.message = dataNodetranslationListtranslationListItem["message"].asString();
|
||||
if(!dataNodetranslationListtranslationListItem["index"].isNull())
|
||||
translationListItemObject.index = dataNodetranslationListtranslationListItem["index"].asString();
|
||||
if(!dataNodetranslationListtranslationListItem["translation"].isNull())
|
||||
translationListItemObject.translation = dataNodetranslationListtranslationListItem["translation"].asString();
|
||||
auto usageNode = value["usage"];
|
||||
if(!usageNode["inputTokens"].isNull())
|
||||
translationListItemObject.usage.inputTokens = std::stol(usageNode["inputTokens"].asString());
|
||||
if(!usageNode["outputTokens"].isNull())
|
||||
translationListItemObject.usage.outputTokens = std::stol(usageNode["outputTokens"].asString());
|
||||
if(!usageNode["totalTokens"].isNull())
|
||||
translationListItemObject.usage.totalTokens = std::stol(usageNode["totalTokens"].asString());
|
||||
data_.translationList.push_back(translationListItemObject);
|
||||
}
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string BatchTranslateResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string BatchTranslateResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string BatchTranslateResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
BatchTranslateResult::Data BatchTranslateResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string BatchTranslateResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool BatchTranslateResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
46
anytrans/src/model/GetDocTranslateTaskRequest.cc
Normal file
46
anytrans/src/model/GetDocTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/anytrans/model/GetDocTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::GetDocTranslateTaskRequest;
|
||||
|
||||
GetDocTranslateTaskRequest::GetDocTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/doc/get"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetDocTranslateTaskRequest::~GetDocTranslateTaskRequest() {}
|
||||
|
||||
std::string GetDocTranslateTaskRequest::getTaskId() const {
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void GetDocTranslateTaskRequest::setTaskId(const std::string &taskId) {
|
||||
taskId_ = taskId;
|
||||
setBodyParameter(std::string("taskId"), taskId);
|
||||
}
|
||||
|
||||
std::string GetDocTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void GetDocTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
95
anytrans/src/model/GetDocTranslateTaskResult.cc
Normal file
95
anytrans/src/model/GetDocTranslateTaskResult.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/anytrans/model/GetDocTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
GetDocTranslateTaskResult::GetDocTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetDocTranslateTaskResult::GetDocTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetDocTranslateTaskResult::~GetDocTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void GetDocTranslateTaskResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
if(!dataNode["taskId"].isNull())
|
||||
data_.taskId = dataNode["taskId"].asString();
|
||||
if(!dataNode["status"].isNull())
|
||||
data_.status = dataNode["status"].asString();
|
||||
if(!dataNode["charactersCount"].isNull())
|
||||
data_.charactersCount = std::stoi(dataNode["charactersCount"].asString());
|
||||
if(!dataNode["pageCount"].isNull())
|
||||
data_.pageCount = std::stoi(dataNode["pageCount"].asString());
|
||||
if(!dataNode["translateFileUrl"].isNull())
|
||||
data_.translateFileUrl = dataNode["translateFileUrl"].asString();
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetDocTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string GetDocTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string GetDocTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
GetDocTranslateTaskResult::Data GetDocTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetDocTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetDocTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
46
anytrans/src/model/GetHtmlTranslateTaskRequest.cc
Normal file
46
anytrans/src/model/GetHtmlTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/anytrans/model/GetHtmlTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::GetHtmlTranslateTaskRequest;
|
||||
|
||||
GetHtmlTranslateTaskRequest::GetHtmlTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/html/get"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetHtmlTranslateTaskRequest::~GetHtmlTranslateTaskRequest() {}
|
||||
|
||||
std::string GetHtmlTranslateTaskRequest::getTaskId() const {
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void GetHtmlTranslateTaskRequest::setTaskId(const std::string &taskId) {
|
||||
taskId_ = taskId;
|
||||
setBodyParameter(std::string("taskId"), taskId);
|
||||
}
|
||||
|
||||
std::string GetHtmlTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void GetHtmlTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
94
anytrans/src/model/GetHtmlTranslateTaskResult.cc
Normal file
94
anytrans/src/model/GetHtmlTranslateTaskResult.cc
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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/anytrans/model/GetHtmlTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
GetHtmlTranslateTaskResult::GetHtmlTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetHtmlTranslateTaskResult::GetHtmlTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetHtmlTranslateTaskResult::~GetHtmlTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void GetHtmlTranslateTaskResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
if(!dataNode["translation"].isNull())
|
||||
data_.translation = dataNode["translation"].asString();
|
||||
auto usageNode = dataNode["usage"];
|
||||
if(!usageNode["inputTokens"].isNull())
|
||||
data_.usage.inputTokens = std::stol(usageNode["inputTokens"].asString());
|
||||
if(!usageNode["outputTokens"].isNull())
|
||||
data_.usage.outputTokens = std::stol(usageNode["outputTokens"].asString());
|
||||
if(!usageNode["totalTokens"].isNull())
|
||||
data_.usage.totalTokens = std::stol(usageNode["totalTokens"].asString());
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetHtmlTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string GetHtmlTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string GetHtmlTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
GetHtmlTranslateTaskResult::Data GetHtmlTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetHtmlTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetHtmlTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
46
anytrans/src/model/GetImageTranslateTaskRequest.cc
Normal file
46
anytrans/src/model/GetImageTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/anytrans/model/GetImageTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::GetImageTranslateTaskRequest;
|
||||
|
||||
GetImageTranslateTaskRequest::GetImageTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/image/get"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetImageTranslateTaskRequest::~GetImageTranslateTaskRequest() {}
|
||||
|
||||
std::string GetImageTranslateTaskRequest::getTaskId() const {
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void GetImageTranslateTaskRequest::setTaskId(const std::string &taskId) {
|
||||
taskId_ = taskId;
|
||||
setBodyParameter(std::string("taskId"), taskId);
|
||||
}
|
||||
|
||||
std::string GetImageTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void GetImageTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
185
anytrans/src/model/GetImageTranslateTaskResult.cc
Normal file
185
anytrans/src/model/GetImageTranslateTaskResult.cc
Normal file
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
* 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/anytrans/model/GetImageTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
GetImageTranslateTaskResult::GetImageTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetImageTranslateTaskResult::GetImageTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetImageTranslateTaskResult::~GetImageTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void GetImageTranslateTaskResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
if(!dataNode["traceId"].isNull())
|
||||
data_.traceId = dataNode["traceId"].asString();
|
||||
auto translationNode = dataNode["translation"];
|
||||
if(!translationNode["angle"].isNull())
|
||||
data_.translation.angle = std::stol(translationNode["angle"].asString());
|
||||
if(!translationNode["width"].isNull())
|
||||
data_.translation.width = std::stol(translationNode["width"].asString());
|
||||
if(!translationNode["height"].isNull())
|
||||
data_.translation.height = std::stol(translationNode["height"].asString());
|
||||
if(!translationNode["orgWidth"].isNull())
|
||||
data_.translation.orgWidth = std::stol(translationNode["orgWidth"].asString());
|
||||
if(!translationNode["orgHeight"].isNull())
|
||||
data_.translation.orgHeight = std::stol(translationNode["orgHeight"].asString());
|
||||
if(!translationNode["boxesCount"].isNull())
|
||||
data_.translation.boxesCount = std::stol(translationNode["boxesCount"].asString());
|
||||
auto allboundingBoxesNode = translationNode["boundingBoxes"]["boundingBoxesItem"];
|
||||
for (auto translationNodeboundingBoxesboundingBoxesItem : allboundingBoxesNode)
|
||||
{
|
||||
Data::Translation::BoundingBoxesItem boundingBoxesItemObject;
|
||||
if(!translationNodeboundingBoxesboundingBoxesItem["confidence"].isNull())
|
||||
boundingBoxesItemObject.confidence = std::stof(translationNodeboundingBoxesboundingBoxesItem["confidence"].asString());
|
||||
if(!translationNodeboundingBoxesboundingBoxesItem["text"].isNull())
|
||||
boundingBoxesItemObject.text = translationNodeboundingBoxesboundingBoxesItem["text"].asString();
|
||||
if(!translationNodeboundingBoxesboundingBoxesItem["direction"].isNull())
|
||||
boundingBoxesItemObject.direction = std::stol(translationNodeboundingBoxesboundingBoxesItem["direction"].asString());
|
||||
if(!translationNodeboundingBoxesboundingBoxesItem["tableId"].isNull())
|
||||
boundingBoxesItemObject.tableId = std::stol(translationNodeboundingBoxesboundingBoxesItem["tableId"].asString());
|
||||
if(!translationNodeboundingBoxesboundingBoxesItem["tableCellId"].isNull())
|
||||
boundingBoxesItemObject.tableCellId = std::stol(translationNodeboundingBoxesboundingBoxesItem["tableCellId"].asString());
|
||||
if(!translationNodeboundingBoxesboundingBoxesItem["translation"].isNull())
|
||||
boundingBoxesItemObject.translation = translationNodeboundingBoxesboundingBoxesItem["translation"].asString();
|
||||
auto upLeftNode = value["upLeft"];
|
||||
if(!upLeftNode["x"].isNull())
|
||||
boundingBoxesItemObject.upLeft.x = std::stol(upLeftNode["x"].asString());
|
||||
if(!upLeftNode["y"].isNull())
|
||||
boundingBoxesItemObject.upLeft.y = std::stol(upLeftNode["y"].asString());
|
||||
auto upRightNode = value["upRight"];
|
||||
if(!upRightNode["x"].isNull())
|
||||
boundingBoxesItemObject.upRight.x = std::stol(upRightNode["x"].asString());
|
||||
if(!upRightNode["y"].isNull())
|
||||
boundingBoxesItemObject.upRight.y = std::stol(upRightNode["y"].asString());
|
||||
auto downLeftNode = value["downLeft"];
|
||||
if(!downLeftNode["x"].isNull())
|
||||
boundingBoxesItemObject.downLeft.x = std::stol(downLeftNode["x"].asString());
|
||||
if(!downLeftNode["y"].isNull())
|
||||
boundingBoxesItemObject.downLeft.y = std::stol(downLeftNode["y"].asString());
|
||||
auto downRightNode = value["downRight"];
|
||||
if(!downRightNode["x"].isNull())
|
||||
boundingBoxesItemObject.downRight.x = std::stol(downRightNode["x"].asString());
|
||||
if(!downRightNode["y"].isNull())
|
||||
boundingBoxesItemObject.downRight.y = std::stol(downRightNode["y"].asString());
|
||||
data_.translation.boundingBoxes.push_back(boundingBoxesItemObject);
|
||||
}
|
||||
auto alltableInfosNode = translationNode["tableInfos"]["tableInfosItem"];
|
||||
for (auto translationNodetableInfostableInfosItem : alltableInfosNode)
|
||||
{
|
||||
Data::Translation::TableInfosItem tableInfosItemObject;
|
||||
if(!translationNodetableInfostableInfosItem["tableId"].isNull())
|
||||
tableInfosItemObject.tableId = std::stol(translationNodetableInfostableInfosItem["tableId"].asString());
|
||||
if(!translationNodetableInfostableInfosItem["xCellSize"].isNull())
|
||||
tableInfosItemObject.xCellSize = std::stol(translationNodetableInfostableInfosItem["xCellSize"].asString());
|
||||
if(!translationNodetableInfostableInfosItem["yCellSize"].isNull())
|
||||
tableInfosItemObject.yCellSize = std::stol(translationNodetableInfostableInfosItem["yCellSize"].asString());
|
||||
auto allcellInfosNode = translationNodetableInfostableInfosItem["cellInfos"]["cellInfosItem"];
|
||||
for (auto translationNodetableInfostableInfosItemcellInfoscellInfosItem : allcellInfosNode)
|
||||
{
|
||||
Data::Translation::TableInfosItem::CellInfosItem cellInfosObject;
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItem["tableCellId"].isNull())
|
||||
cellInfosObject.tableCellId = std::stol(translationNodetableInfostableInfosItemcellInfoscellInfosItem["tableCellId"].asString());
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItem["text"].isNull())
|
||||
cellInfosObject.text = translationNodetableInfostableInfosItemcellInfoscellInfosItem["text"].asString();
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItem["xsc"].isNull())
|
||||
cellInfosObject.xsc = std::stol(translationNodetableInfostableInfosItemcellInfoscellInfosItem["xsc"].asString());
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItem["xec"].isNull())
|
||||
cellInfosObject.xec = std::stol(translationNodetableInfostableInfosItemcellInfoscellInfosItem["xec"].asString());
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItem["ysc"].isNull())
|
||||
cellInfosObject.ysc = std::stol(translationNodetableInfostableInfosItemcellInfoscellInfosItem["ysc"].asString());
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItem["yec"].isNull())
|
||||
cellInfosObject.yec = std::stol(translationNodetableInfostableInfosItemcellInfoscellInfosItem["yec"].asString());
|
||||
auto allposNode = translationNodetableInfostableInfosItemcellInfoscellInfosItem["pos"]["posItem"];
|
||||
for (auto translationNodetableInfostableInfosItemcellInfoscellInfosItemposposItem : allposNode)
|
||||
{
|
||||
Data::Translation::TableInfosItem::CellInfosItem::PosItem posObject;
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItemposposItem["x"].isNull())
|
||||
posObject.x = std::stol(translationNodetableInfostableInfosItemcellInfoscellInfosItemposposItem["x"].asString());
|
||||
if(!translationNodetableInfostableInfosItemcellInfoscellInfosItemposposItem["y"].isNull())
|
||||
posObject.y = std::stol(translationNodetableInfostableInfosItemcellInfoscellInfosItemposposItem["y"].asString());
|
||||
cellInfosObject.pos.push_back(posObject);
|
||||
}
|
||||
tableInfosItemObject.cellInfos.push_back(cellInfosObject);
|
||||
}
|
||||
data_.translation.tableInfos.push_back(tableInfosItemObject);
|
||||
}
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
if(!value["synchro"].isNull())
|
||||
synchro_ = value["synchro"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
std::string GetImageTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string GetImageTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
bool GetImageTranslateTaskResult::getSynchro()const
|
||||
{
|
||||
return synchro_;
|
||||
}
|
||||
|
||||
std::string GetImageTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
GetImageTranslateTaskResult::Data GetImageTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetImageTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetImageTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
46
anytrans/src/model/GetLongTextTranslateTaskRequest.cc
Normal file
46
anytrans/src/model/GetLongTextTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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/anytrans/model/GetLongTextTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::GetLongTextTranslateTaskRequest;
|
||||
|
||||
GetLongTextTranslateTaskRequest::GetLongTextTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/longText/get"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetLongTextTranslateTaskRequest::~GetLongTextTranslateTaskRequest() {}
|
||||
|
||||
std::string GetLongTextTranslateTaskRequest::getTaskId() const {
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void GetLongTextTranslateTaskRequest::setTaskId(const std::string &taskId) {
|
||||
taskId_ = taskId;
|
||||
setBodyParameter(std::string("taskId"), taskId);
|
||||
}
|
||||
|
||||
std::string GetLongTextTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void GetLongTextTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
94
anytrans/src/model/GetLongTextTranslateTaskResult.cc
Normal file
94
anytrans/src/model/GetLongTextTranslateTaskResult.cc
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* 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/anytrans/model/GetLongTextTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
GetLongTextTranslateTaskResult::GetLongTextTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetLongTextTranslateTaskResult::GetLongTextTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetLongTextTranslateTaskResult::~GetLongTextTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void GetLongTextTranslateTaskResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
if(!dataNode["translation"].isNull())
|
||||
data_.translation = dataNode["translation"].asString();
|
||||
auto usageNode = dataNode["usage"];
|
||||
if(!usageNode["inputTokens"].isNull())
|
||||
data_.usage.inputTokens = std::stol(usageNode["inputTokens"].asString());
|
||||
if(!usageNode["outputTokens"].isNull())
|
||||
data_.usage.outputTokens = std::stol(usageNode["outputTokens"].asString());
|
||||
if(!usageNode["totalTokens"].isNull())
|
||||
data_.usage.totalTokens = std::stol(usageNode["totalTokens"].asString());
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string GetLongTextTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string GetLongTextTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string GetLongTextTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
GetLongTextTranslateTaskResult::Data GetLongTextTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetLongTextTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetLongTextTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
96
anytrans/src/model/SubmitDocTranslateTaskRequest.cc
Normal file
96
anytrans/src/model/SubmitDocTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 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/anytrans/model/SubmitDocTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::SubmitDocTranslateTaskRequest;
|
||||
|
||||
SubmitDocTranslateTaskRequest::SubmitDocTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/doc/submit"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SubmitDocTranslateTaskRequest::~SubmitDocTranslateTaskRequest() {}
|
||||
|
||||
SubmitDocTranslateTaskRequest::ext SubmitDocTranslateTaskRequest::getExt() const {
|
||||
return ext_;
|
||||
}
|
||||
|
||||
void SubmitDocTranslateTaskRequest::setExt(const SubmitDocTranslateTaskRequest::ext &ext) {
|
||||
ext_ = ext;
|
||||
for(int dep1 = 0; dep1 != ext.terminologies.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".tgt", ext.terminologies[dep1].tgt);
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".src", ext.terminologies[dep1].src);
|
||||
}
|
||||
setBodyParameter(std::string("ext") + ".config.skipImgTrans", ext.config.skipImgTrans ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".domainHint", ext.domainHint);
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskRequest::getSourceLanguage() const {
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void SubmitDocTranslateTaskRequest::setSourceLanguage(const std::string &sourceLanguage) {
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter(std::string("sourceLanguage"), sourceLanguage);
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskRequest::getFormat() const {
|
||||
return format_;
|
||||
}
|
||||
|
||||
void SubmitDocTranslateTaskRequest::setFormat(const std::string &format) {
|
||||
format_ = format;
|
||||
setBodyParameter(std::string("format"), format);
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskRequest::getScene() const {
|
||||
return scene_;
|
||||
}
|
||||
|
||||
void SubmitDocTranslateTaskRequest::setScene(const std::string &scene) {
|
||||
scene_ = scene;
|
||||
setBodyParameter(std::string("scene"), scene);
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskRequest::getTargetLanguage() const {
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void SubmitDocTranslateTaskRequest::setTargetLanguage(const std::string &targetLanguage) {
|
||||
targetLanguage_ = targetLanguage;
|
||||
setBodyParameter(std::string("targetLanguage"), targetLanguage);
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void SubmitDocTranslateTaskRequest::setText(const std::string &text) {
|
||||
text_ = text;
|
||||
setBodyParameter(std::string("text"), text);
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void SubmitDocTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
89
anytrans/src/model/SubmitDocTranslateTaskResult.cc
Normal file
89
anytrans/src/model/SubmitDocTranslateTaskResult.cc
Normal file
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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/anytrans/model/SubmitDocTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
SubmitDocTranslateTaskResult::SubmitDocTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SubmitDocTranslateTaskResult::SubmitDocTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SubmitDocTranslateTaskResult::~SubmitDocTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void SubmitDocTranslateTaskResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["data"];
|
||||
if(!dataNode["taskId"].isNull())
|
||||
data_.taskId = dataNode["taskId"].asString();
|
||||
if(!dataNode["status"].isNull())
|
||||
data_.status = dataNode["status"].asString();
|
||||
if(!value["code"].isNull())
|
||||
code_ = value["code"].asString();
|
||||
if(!value["message"].isNull())
|
||||
message_ = value["message"].asString();
|
||||
if(!value["requestId"].isNull())
|
||||
requestId_ = value["requestId"].asString();
|
||||
if(!value["success"].isNull())
|
||||
success_ = value["success"].asString() == "true";
|
||||
if(!value["httpStatusCode"].isNull())
|
||||
httpStatusCode_ = value["httpStatusCode"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
SubmitDocTranslateTaskResult::Data SubmitDocTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string SubmitDocTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SubmitDocTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
107
anytrans/src/model/SubmitHtmlTranslateTaskRequest.cc
Normal file
107
anytrans/src/model/SubmitHtmlTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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/anytrans/model/SubmitHtmlTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::SubmitHtmlTranslateTaskRequest;
|
||||
|
||||
SubmitHtmlTranslateTaskRequest::SubmitHtmlTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/html/submit"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SubmitHtmlTranslateTaskRequest::~SubmitHtmlTranslateTaskRequest() {}
|
||||
|
||||
SubmitHtmlTranslateTaskRequest::ext SubmitHtmlTranslateTaskRequest::getExt() const {
|
||||
return ext_;
|
||||
}
|
||||
|
||||
void SubmitHtmlTranslateTaskRequest::setExt(const SubmitHtmlTranslateTaskRequest::ext &ext) {
|
||||
ext_ = ext;
|
||||
for(int dep1 = 0; dep1 != ext.sensitives.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".sensitives." + std::to_string(dep1 + 1), ext.sensitives[dep1]);
|
||||
}
|
||||
for(int dep1 = 0; dep1 != ext.terminologies.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".tgt", ext.terminologies[dep1].tgt);
|
||||
setBodyParameter(std::string("ext") + ".terminologies." + std::to_string(dep1 + 1) + ".src", ext.terminologies[dep1].src);
|
||||
}
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toLower", ext.textTransform.toLower ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toUpper", ext.textTransform.toUpper ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".textTransform.toTitle", ext.textTransform.toTitle ? "true" : "false");
|
||||
for(int dep1 = 0; dep1 != ext.examples.size(); dep1++) {
|
||||
setBodyParameter(std::string("ext") + ".examples." + std::to_string(dep1 + 1) + ".tgt", ext.examples[dep1].tgt);
|
||||
setBodyParameter(std::string("ext") + ".examples." + std::to_string(dep1 + 1) + ".src", ext.examples[dep1].src);
|
||||
}
|
||||
setBodyParameter(std::string("ext") + ".config.skipCsiCheck", ext.config.skipCsiCheck ? "true" : "false");
|
||||
setBodyParameter(std::string("ext") + ".config.callbackUrl", ext.config.callbackUrl);
|
||||
setBodyParameter(std::string("ext") + ".domainHint", ext.domainHint);
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskRequest::getSourceLanguage() const {
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void SubmitHtmlTranslateTaskRequest::setSourceLanguage(const std::string &sourceLanguage) {
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter(std::string("sourceLanguage"), sourceLanguage);
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskRequest::getFormat() const {
|
||||
return format_;
|
||||
}
|
||||
|
||||
void SubmitHtmlTranslateTaskRequest::setFormat(const std::string &format) {
|
||||
format_ = format;
|
||||
setBodyParameter(std::string("format"), format);
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskRequest::getScene() const {
|
||||
return scene_;
|
||||
}
|
||||
|
||||
void SubmitHtmlTranslateTaskRequest::setScene(const std::string &scene) {
|
||||
scene_ = scene;
|
||||
setBodyParameter(std::string("scene"), scene);
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskRequest::getTargetLanguage() const {
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void SubmitHtmlTranslateTaskRequest::setTargetLanguage(const std::string &targetLanguage) {
|
||||
targetLanguage_ = targetLanguage;
|
||||
setBodyParameter(std::string("targetLanguage"), targetLanguage);
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void SubmitHtmlTranslateTaskRequest::setText(const std::string &text) {
|
||||
text_ = text;
|
||||
setBodyParameter(std::string("text"), text);
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void SubmitHtmlTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user