Release on full language support.
This commit is contained in:
62
hiknoengine/src/model/TranslateTextRequest.cc
Normal file
62
hiknoengine/src/model/TranslateTextRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/hiknoengine/model/TranslateTextRequest.h>
|
||||
|
||||
using AlibabaCloud::Hiknoengine::Model::TranslateTextRequest;
|
||||
|
||||
TranslateTextRequest::TranslateTextRequest() :
|
||||
RpcServiceRequest("hiknoengine", "2019-06-25", "TranslateText")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
TranslateTextRequest::~TranslateTextRequest()
|
||||
{}
|
||||
|
||||
std::string TranslateTextRequest::getFromLang()const
|
||||
{
|
||||
return fromLang_;
|
||||
}
|
||||
|
||||
void TranslateTextRequest::setFromLang(const std::string& fromLang)
|
||||
{
|
||||
fromLang_ = fromLang;
|
||||
setCoreParameter("FromLang", fromLang);
|
||||
}
|
||||
|
||||
std::string TranslateTextRequest::getToLang()const
|
||||
{
|
||||
return toLang_;
|
||||
}
|
||||
|
||||
void TranslateTextRequest::setToLang(const std::string& toLang)
|
||||
{
|
||||
toLang_ = toLang;
|
||||
setCoreParameter("ToLang", toLang);
|
||||
}
|
||||
|
||||
std::string TranslateTextRequest::getText()const
|
||||
{
|
||||
return text_;
|
||||
}
|
||||
|
||||
void TranslateTextRequest::setText(const std::string& text)
|
||||
{
|
||||
text_ = text;
|
||||
setCoreParameter("Text", text);
|
||||
}
|
||||
|
||||
66
hiknoengine/src/model/TranslateTextResult.cc
Normal file
66
hiknoengine/src/model/TranslateTextResult.cc
Normal file
@@ -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.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/hiknoengine/model/TranslateTextResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Hiknoengine;
|
||||
using namespace AlibabaCloud::Hiknoengine::Model;
|
||||
|
||||
TranslateTextResult::TranslateTextResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
TranslateTextResult::TranslateTextResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
TranslateTextResult::~TranslateTextResult()
|
||||
{}
|
||||
|
||||
void TranslateTextResult::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["Text"].isNull())
|
||||
data_.text = dataNode["Text"].asString();
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["Message"].isNull())
|
||||
message_ = value["Message"].asString();
|
||||
|
||||
}
|
||||
|
||||
std::string TranslateTextResult::getMessage()const
|
||||
{
|
||||
return message_;
|
||||
}
|
||||
|
||||
TranslateTextResult::Data TranslateTextResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string TranslateTextResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user