Generated 2025-07-07 for AnyTrans.
This commit is contained in:
122
anytrans/CMakeLists.txt
Normal file
122
anytrans/CMakeLists.txt
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.
|
||||
#
|
||||
|
||||
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/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/TextTranslateRequest.h
|
||||
include/alibabacloud/anytrans/model/TextTranslateResult.h )
|
||||
|
||||
set(anytrans_src
|
||||
src/AnyTransClient.cc
|
||||
src/model/BatchTranslateRequest.cc
|
||||
src/model/BatchTranslateResult.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/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}
|
||||
)
|
||||
126
anytrans/include/alibabacloud/anytrans/AnyTransClient.h
Normal file
126
anytrans/include/alibabacloud/anytrans/AnyTransClient.h
Normal file
@@ -0,0 +1,126 @@
|
||||
/*
|
||||
* 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/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/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::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::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;
|
||||
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;
|
||||
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,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_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;
|
||||
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 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 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,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_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 {
|
||||
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;
|
||||
};
|
||||
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,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_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;
|
||||
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,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_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;
|
||||
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,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_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;
|
||||
struct ExamplesItem {
|
||||
std::string tgt;
|
||||
std::string src;
|
||||
};
|
||||
examplesItem examplesItem;
|
||||
std::vector<examplesItem> examples;
|
||||
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_
|
||||
413
anytrans/src/AnyTransClient.cc
Normal file
413
anytrans/src/AnyTransClient.cc
Normal file
@@ -0,0 +1,413 @@
|
||||
/*
|
||||
* 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::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::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();
|
||||
}
|
||||
|
||||
107
anytrans/src/model/BatchTranslateRequest.cc
Normal file
107
anytrans/src/model/BatchTranslateRequest.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/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") + ".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::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_;
|
||||
}
|
||||
|
||||
105
anytrans/src/model/SubmitDocTranslateTaskRequest.cc
Normal file
105
anytrans/src/model/SubmitDocTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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.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") + ".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_;
|
||||
}
|
||||
|
||||
105
anytrans/src/model/SubmitHtmlTranslateTaskRequest.cc
Normal file
105
anytrans/src/model/SubmitHtmlTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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") + ".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);
|
||||
}
|
||||
|
||||
89
anytrans/src/model/SubmitHtmlTranslateTaskResult.cc
Normal file
89
anytrans/src/model/SubmitHtmlTranslateTaskResult.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/SubmitHtmlTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
SubmitHtmlTranslateTaskResult::SubmitHtmlTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SubmitHtmlTranslateTaskResult::SubmitHtmlTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SubmitHtmlTranslateTaskResult::~SubmitHtmlTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void SubmitHtmlTranslateTaskResult::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 SubmitHtmlTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
SubmitHtmlTranslateTaskResult::Data SubmitHtmlTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string SubmitHtmlTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SubmitHtmlTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
107
anytrans/src/model/SubmitImageTranslateTaskRequest.cc
Normal file
107
anytrans/src/model/SubmitImageTranslateTaskRequest.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/SubmitImageTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::SubmitImageTranslateTaskRequest;
|
||||
|
||||
SubmitImageTranslateTaskRequest::SubmitImageTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/image/submit"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SubmitImageTranslateTaskRequest::~SubmitImageTranslateTaskRequest() {}
|
||||
|
||||
SubmitImageTranslateTaskRequest::ext SubmitImageTranslateTaskRequest::getExt() const {
|
||||
return ext_;
|
||||
}
|
||||
|
||||
void SubmitImageTranslateTaskRequest::setExt(const SubmitImageTranslateTaskRequest::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") + ".domainHint", ext.domainHint);
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskRequest::getSourceLanguage() const {
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void SubmitImageTranslateTaskRequest::setSourceLanguage(const std::string &sourceLanguage) {
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter(std::string("sourceLanguage"), sourceLanguage);
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskRequest::getFormat() const {
|
||||
return format_;
|
||||
}
|
||||
|
||||
void SubmitImageTranslateTaskRequest::setFormat(const std::string &format) {
|
||||
format_ = format;
|
||||
setBodyParameter(std::string("format"), format);
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskRequest::getScene() const {
|
||||
return scene_;
|
||||
}
|
||||
|
||||
void SubmitImageTranslateTaskRequest::setScene(const std::string &scene) {
|
||||
scene_ = scene;
|
||||
setBodyParameter(std::string("scene"), scene);
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void SubmitImageTranslateTaskRequest::setText(const std::string &text) {
|
||||
text_ = text;
|
||||
setBodyParameter(std::string("text"), text);
|
||||
}
|
||||
|
||||
std::vector<SubmitImageTranslateTaskRequest::std::string> SubmitImageTranslateTaskRequest::getTargetLanguage() const {
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void SubmitImageTranslateTaskRequest::setTargetLanguage(const std::vector<SubmitImageTranslateTaskRequest::std::string> &targetLanguage) {
|
||||
targetLanguage_ = targetLanguage;
|
||||
for(int dep1 = 0; dep1 != targetLanguage.size(); dep1++) {
|
||||
setBodyParameter(std::string("targetLanguage") + "." + std::to_string(dep1 + 1), targetLanguage[dep1]);
|
||||
}
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void SubmitImageTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
89
anytrans/src/model/SubmitImageTranslateTaskResult.cc
Normal file
89
anytrans/src/model/SubmitImageTranslateTaskResult.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/SubmitImageTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
SubmitImageTranslateTaskResult::SubmitImageTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SubmitImageTranslateTaskResult::SubmitImageTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SubmitImageTranslateTaskResult::~SubmitImageTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void SubmitImageTranslateTaskResult::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 SubmitImageTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
SubmitImageTranslateTaskResult::Data SubmitImageTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string SubmitImageTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SubmitImageTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
105
anytrans/src/model/SubmitLongTextTranslateTaskRequest.cc
Normal file
105
anytrans/src/model/SubmitLongTextTranslateTaskRequest.cc
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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/SubmitLongTextTranslateTaskRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::SubmitLongTextTranslateTaskRequest;
|
||||
|
||||
SubmitLongTextTranslateTaskRequest::SubmitLongTextTranslateTaskRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/longText/submit"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
SubmitLongTextTranslateTaskRequest::~SubmitLongTextTranslateTaskRequest() {}
|
||||
|
||||
SubmitLongTextTranslateTaskRequest::ext SubmitLongTextTranslateTaskRequest::getExt() const {
|
||||
return ext_;
|
||||
}
|
||||
|
||||
void SubmitLongTextTranslateTaskRequest::setExt(const SubmitLongTextTranslateTaskRequest::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") + ".domainHint", ext.domainHint);
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskRequest::getSourceLanguage() const {
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void SubmitLongTextTranslateTaskRequest::setSourceLanguage(const std::string &sourceLanguage) {
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter(std::string("sourceLanguage"), sourceLanguage);
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskRequest::getFormat() const {
|
||||
return format_;
|
||||
}
|
||||
|
||||
void SubmitLongTextTranslateTaskRequest::setFormat(const std::string &format) {
|
||||
format_ = format;
|
||||
setBodyParameter(std::string("format"), format);
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskRequest::getScene() const {
|
||||
return scene_;
|
||||
}
|
||||
|
||||
void SubmitLongTextTranslateTaskRequest::setScene(const std::string &scene) {
|
||||
scene_ = scene;
|
||||
setBodyParameter(std::string("scene"), scene);
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskRequest::getTargetLanguage() const {
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void SubmitLongTextTranslateTaskRequest::setTargetLanguage(const std::string &targetLanguage) {
|
||||
targetLanguage_ = targetLanguage;
|
||||
setBodyParameter(std::string("targetLanguage"), targetLanguage);
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void SubmitLongTextTranslateTaskRequest::setText(const std::string &text) {
|
||||
text_ = text;
|
||||
setBodyParameter(std::string("text"), text);
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void SubmitLongTextTranslateTaskRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
89
anytrans/src/model/SubmitLongTextTranslateTaskResult.cc
Normal file
89
anytrans/src/model/SubmitLongTextTranslateTaskResult.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/SubmitLongTextTranslateTaskResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
SubmitLongTextTranslateTaskResult::SubmitLongTextTranslateTaskResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
SubmitLongTextTranslateTaskResult::SubmitLongTextTranslateTaskResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
SubmitLongTextTranslateTaskResult::~SubmitLongTextTranslateTaskResult()
|
||||
{}
|
||||
|
||||
void SubmitLongTextTranslateTaskResult::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 SubmitLongTextTranslateTaskResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
SubmitLongTextTranslateTaskResult::Data SubmitLongTextTranslateTaskResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string SubmitLongTextTranslateTaskResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool SubmitLongTextTranslateTaskResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
105
anytrans/src/model/TextTranslateRequest.cc
Normal file
105
anytrans/src/model/TextTranslateRequest.cc
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* 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/TextTranslateRequest.h>
|
||||
|
||||
using AlibabaCloud::AnyTrans::Model::TextTranslateRequest;
|
||||
|
||||
TextTranslateRequest::TextTranslateRequest()
|
||||
: RoaServiceRequest("anytrans", "2025-07-07") {
|
||||
setResourcePath("/anytrans/translate/text"};
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
TextTranslateRequest::~TextTranslateRequest() {}
|
||||
|
||||
TextTranslateRequest::ext TextTranslateRequest::getExt() const {
|
||||
return ext_;
|
||||
}
|
||||
|
||||
void TextTranslateRequest::setExt(const TextTranslateRequest::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") + ".domainHint", ext.domainHint);
|
||||
}
|
||||
|
||||
std::string TextTranslateRequest::getSourceLanguage() const {
|
||||
return sourceLanguage_;
|
||||
}
|
||||
|
||||
void TextTranslateRequest::setSourceLanguage(const std::string &sourceLanguage) {
|
||||
sourceLanguage_ = sourceLanguage;
|
||||
setBodyParameter(std::string("sourceLanguage"), sourceLanguage);
|
||||
}
|
||||
|
||||
std::string TextTranslateRequest::getFormat() const {
|
||||
return format_;
|
||||
}
|
||||
|
||||
void TextTranslateRequest::setFormat(const std::string &format) {
|
||||
format_ = format;
|
||||
setBodyParameter(std::string("format"), format);
|
||||
}
|
||||
|
||||
std::string TextTranslateRequest::getScene() const {
|
||||
return scene_;
|
||||
}
|
||||
|
||||
void TextTranslateRequest::setScene(const std::string &scene) {
|
||||
scene_ = scene;
|
||||
setBodyParameter(std::string("scene"), scene);
|
||||
}
|
||||
|
||||
std::string TextTranslateRequest::getTargetLanguage() const {
|
||||
return targetLanguage_;
|
||||
}
|
||||
|
||||
void TextTranslateRequest::setTargetLanguage(const std::string &targetLanguage) {
|
||||
targetLanguage_ = targetLanguage;
|
||||
setBodyParameter(std::string("targetLanguage"), targetLanguage);
|
||||
}
|
||||
|
||||
std::string TextTranslateRequest::getText() const {
|
||||
return text_;
|
||||
}
|
||||
|
||||
void TextTranslateRequest::setText(const std::string &text) {
|
||||
text_ = text;
|
||||
setBodyParameter(std::string("text"), text);
|
||||
}
|
||||
|
||||
std::string TextTranslateRequest::getWorkspaceId() const {
|
||||
return workspaceId_;
|
||||
}
|
||||
|
||||
void TextTranslateRequest::setWorkspaceId(const std::string &workspaceId) {
|
||||
workspaceId_ = workspaceId;
|
||||
setBodyParameter(std::string("workspaceId"), workspaceId);
|
||||
}
|
||||
|
||||
94
anytrans/src/model/TextTranslateResult.cc
Normal file
94
anytrans/src/model/TextTranslateResult.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/TextTranslateResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::AnyTrans;
|
||||
using namespace AlibabaCloud::AnyTrans::Model;
|
||||
|
||||
TextTranslateResult::TextTranslateResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
TextTranslateResult::TextTranslateResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
TextTranslateResult::~TextTranslateResult()
|
||||
{}
|
||||
|
||||
void TextTranslateResult::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 TextTranslateResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
std::string TextTranslateResult::getRequestId()const
|
||||
{
|
||||
return requestId_;
|
||||
}
|
||||
|
||||
std::string TextTranslateResult::getHttpStatusCode()const
|
||||
{
|
||||
return httpStatusCode_;
|
||||
}
|
||||
|
||||
TextTranslateResult::Data TextTranslateResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string TextTranslateResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool TextTranslateResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user