Release on full language support.

This commit is contained in:
sdk-team
2020-01-20 17:21:10 +08:00
parent b4e95dcd5a
commit 4c2ebf13d5
10 changed files with 506 additions and 1 deletions

View File

@@ -0,0 +1,54 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_HIKNOENGINE_HIKNOENGINECLIENT_H_
#define ALIBABACLOUD_HIKNOENGINE_HIKNOENGINECLIENT_H_
#include <future>
#include <alibabacloud/core/AsyncCallerContext.h>
#include <alibabacloud/core/EndpointProvider.h>
#include <alibabacloud/core/RpcServiceClient.h>
#include "HiknoengineExport.h"
#include "model/TranslateTextRequest.h"
#include "model/TranslateTextResult.h"
namespace AlibabaCloud
{
namespace Hiknoengine
{
class ALIBABACLOUD_HIKNOENGINE_EXPORT HiknoengineClient : public RpcServiceClient
{
public:
typedef Outcome<Error, Model::TranslateTextResult> TranslateTextOutcome;
typedef std::future<TranslateTextOutcome> TranslateTextOutcomeCallable;
typedef std::function<void(const HiknoengineClient*, const Model::TranslateTextRequest&, const TranslateTextOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TranslateTextAsyncHandler;
HiknoengineClient(const Credentials &credentials, const ClientConfiguration &configuration);
HiknoengineClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
HiknoengineClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
~HiknoengineClient();
TranslateTextOutcome translateText(const Model::TranslateTextRequest &request)const;
void translateTextAsync(const Model::TranslateTextRequest& request, const TranslateTextAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
TranslateTextOutcomeCallable translateTextCallable(const Model::TranslateTextRequest& request) const;
private:
std::shared_ptr<EndpointProvider> endpointProvider_;
};
}
}
#endif // !ALIBABACLOUD_HIKNOENGINE_HIKNOENGINECLIENT_H_

View 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_HIKNOENGINE_HIKNOENGINEEXPORT_H_
#define ALIBABACLOUD_HIKNOENGINE_HIKNOENGINEEXPORT_H_
#include <alibabacloud/core/Global.h>
#if defined(ALIBABACLOUD_SHARED)
# if defined(ALIBABACLOUD_HIKNOENGINE_LIBRARY)
# define ALIBABACLOUD_HIKNOENGINE_EXPORT ALIBABACLOUD_DECL_EXPORT
# else
# define ALIBABACLOUD_HIKNOENGINE_EXPORT ALIBABACLOUD_DECL_IMPORT
# endif
#else
# define ALIBABACLOUD_HIKNOENGINE_EXPORT
#endif
#endif // !ALIBABACLOUD_HIKNOENGINE_HIKNOENGINEEXPORT_H_

View File

@@ -0,0 +1,54 @@
/*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_HIKNOENGINE_MODEL_TRANSLATETEXTREQUEST_H_
#define ALIBABACLOUD_HIKNOENGINE_MODEL_TRANSLATETEXTREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/hiknoengine/HiknoengineExport.h>
namespace AlibabaCloud
{
namespace Hiknoengine
{
namespace Model
{
class ALIBABACLOUD_HIKNOENGINE_EXPORT TranslateTextRequest : public RpcServiceRequest
{
public:
TranslateTextRequest();
~TranslateTextRequest();
std::string getFromLang()const;
void setFromLang(const std::string& fromLang);
std::string getToLang()const;
void setToLang(const std::string& toLang);
std::string getText()const;
void setText(const std::string& text);
private:
std::string fromLang_;
std::string toLang_;
std::string text_;
};
}
}
}
#endif // !ALIBABACLOUD_HIKNOENGINE_MODEL_TRANSLATETEXTREQUEST_H_

View File

@@ -0,0 +1,59 @@
/*
* 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_HIKNOENGINE_MODEL_TRANSLATETEXTRESULT_H_
#define ALIBABACLOUD_HIKNOENGINE_MODEL_TRANSLATETEXTRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/hiknoengine/HiknoengineExport.h>
namespace AlibabaCloud
{
namespace Hiknoengine
{
namespace Model
{
class ALIBABACLOUD_HIKNOENGINE_EXPORT TranslateTextResult : public ServiceResult
{
public:
struct Data
{
std::string text;
};
TranslateTextResult();
explicit TranslateTextResult(const std::string &payload);
~TranslateTextResult();
std::string getMessage()const;
Data getData()const;
std::string getCode()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
Data data_;
std::string code_;
};
}
}
}
#endif // !ALIBABACLOUD_HIKNOENGINE_MODEL_TRANSLATETEXTRESULT_H_