From 52ee14ba5dc525bc317ceb24f554054efc247477 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Fri, 7 Aug 2020 16:09:08 +0800 Subject: [PATCH] GetTitleDiagnose GetTitleGenerate GetImageTranslate supported. --- CHANGELOG | 3 + VERSION | 2 +- alimt/CMakeLists.txt | 16 ++ .../include/alibabacloud/alimt/AlimtClient.h | 32 ++++ .../alimt/model/GetImageDiagnoseRequest.h | 51 ++++++ .../alimt/model/GetImageDiagnoseResult.h | 59 +++++++ .../alimt/model/GetImageTranslateRequest.h | 57 +++++++ .../alimt/model/GetImageTranslateResult.h | 59 +++++++ .../alimt/model/GetTitleDiagnoseRequest.h | 60 +++++++ .../alimt/model/GetTitleDiagnoseResult.h | 68 ++++++++ .../alimt/model/GetTitleGenerateRequest.h | 66 ++++++++ .../alimt/model/GetTitleGenerateResult.h | 59 +++++++ alimt/src/AlimtClient.cc | 150 +++++++++++++++++- alimt/src/model/GetImageDiagnoseRequest.cc | 51 ++++++ alimt/src/model/GetImageDiagnoseResult.cc | 66 ++++++++ alimt/src/model/GetImageTranslateRequest.cc | 73 +++++++++ alimt/src/model/GetImageTranslateResult.cc | 66 ++++++++ alimt/src/model/GetTitleDiagnoseRequest.cc | 84 ++++++++++ alimt/src/model/GetTitleDiagnoseResult.cc | 84 ++++++++++ alimt/src/model/GetTitleGenerateRequest.cc | 106 +++++++++++++ alimt/src/model/GetTitleGenerateResult.cc | 66 ++++++++ 21 files changed, 1274 insertions(+), 4 deletions(-) create mode 100644 alimt/include/alibabacloud/alimt/model/GetImageDiagnoseRequest.h create mode 100644 alimt/include/alibabacloud/alimt/model/GetImageDiagnoseResult.h create mode 100644 alimt/include/alibabacloud/alimt/model/GetImageTranslateRequest.h create mode 100644 alimt/include/alibabacloud/alimt/model/GetImageTranslateResult.h create mode 100644 alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseRequest.h create mode 100644 alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseResult.h create mode 100644 alimt/include/alibabacloud/alimt/model/GetTitleGenerateRequest.h create mode 100644 alimt/include/alibabacloud/alimt/model/GetTitleGenerateResult.h create mode 100644 alimt/src/model/GetImageDiagnoseRequest.cc create mode 100644 alimt/src/model/GetImageDiagnoseResult.cc create mode 100644 alimt/src/model/GetImageTranslateRequest.cc create mode 100644 alimt/src/model/GetImageTranslateResult.cc create mode 100644 alimt/src/model/GetTitleDiagnoseRequest.cc create mode 100644 alimt/src/model/GetTitleDiagnoseResult.cc create mode 100644 alimt/src/model/GetTitleGenerateRequest.cc create mode 100644 alimt/src/model/GetTitleGenerateResult.cc diff --git a/CHANGELOG b/CHANGELOG index fa11c0595..9c2b890f8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2020-08-07 Version: 1.36.559 +- GetTitleDiagnose GetTitleGenerate GetImageTranslate supported. + 2020-08-07 Version: 1.36.558 - Add FindServiceList and GetService qps. diff --git a/VERSION b/VERSION index 20c85e682..228efdbcb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.36.558 \ No newline at end of file +1.36.559 \ No newline at end of file diff --git a/alimt/CMakeLists.txt b/alimt/CMakeLists.txt index ae2bd5ba1..6a1405156 100644 --- a/alimt/CMakeLists.txt +++ b/alimt/CMakeLists.txt @@ -27,6 +27,14 @@ set(alimt_public_header_model include/alibabacloud/alimt/model/GetDetectLanguageResult.h include/alibabacloud/alimt/model/GetDocTranslateTaskRequest.h include/alibabacloud/alimt/model/GetDocTranslateTaskResult.h + include/alibabacloud/alimt/model/GetImageDiagnoseRequest.h + include/alibabacloud/alimt/model/GetImageDiagnoseResult.h + include/alibabacloud/alimt/model/GetImageTranslateRequest.h + include/alibabacloud/alimt/model/GetImageTranslateResult.h + include/alibabacloud/alimt/model/GetTitleDiagnoseRequest.h + include/alibabacloud/alimt/model/GetTitleDiagnoseResult.h + include/alibabacloud/alimt/model/GetTitleGenerateRequest.h + include/alibabacloud/alimt/model/GetTitleGenerateResult.h include/alibabacloud/alimt/model/TranslateRequest.h include/alibabacloud/alimt/model/TranslateResult.h include/alibabacloud/alimt/model/TranslateCertificateRequest.h @@ -44,6 +52,14 @@ set(alimt_src src/model/GetDetectLanguageResult.cc src/model/GetDocTranslateTaskRequest.cc src/model/GetDocTranslateTaskResult.cc + src/model/GetImageDiagnoseRequest.cc + src/model/GetImageDiagnoseResult.cc + src/model/GetImageTranslateRequest.cc + src/model/GetImageTranslateResult.cc + src/model/GetTitleDiagnoseRequest.cc + src/model/GetTitleDiagnoseResult.cc + src/model/GetTitleGenerateRequest.cc + src/model/GetTitleGenerateResult.cc src/model/TranslateRequest.cc src/model/TranslateResult.cc src/model/TranslateCertificateRequest.cc diff --git a/alimt/include/alibabacloud/alimt/AlimtClient.h b/alimt/include/alibabacloud/alimt/AlimtClient.h index f6491e6c7..57b45eb59 100644 --- a/alimt/include/alibabacloud/alimt/AlimtClient.h +++ b/alimt/include/alibabacloud/alimt/AlimtClient.h @@ -28,6 +28,14 @@ #include "model/GetDetectLanguageResult.h" #include "model/GetDocTranslateTaskRequest.h" #include "model/GetDocTranslateTaskResult.h" +#include "model/GetImageDiagnoseRequest.h" +#include "model/GetImageDiagnoseResult.h" +#include "model/GetImageTranslateRequest.h" +#include "model/GetImageTranslateResult.h" +#include "model/GetTitleDiagnoseRequest.h" +#include "model/GetTitleDiagnoseResult.h" +#include "model/GetTitleGenerateRequest.h" +#include "model/GetTitleGenerateResult.h" #include "model/TranslateRequest.h" #include "model/TranslateResult.h" #include "model/TranslateCertificateRequest.h" @@ -54,6 +62,18 @@ namespace AlibabaCloud typedef Outcome GetDocTranslateTaskOutcome; typedef std::future GetDocTranslateTaskOutcomeCallable; typedef std::function&)> GetDocTranslateTaskAsyncHandler; + typedef Outcome GetImageDiagnoseOutcome; + typedef std::future GetImageDiagnoseOutcomeCallable; + typedef std::function&)> GetImageDiagnoseAsyncHandler; + typedef Outcome GetImageTranslateOutcome; + typedef std::future GetImageTranslateOutcomeCallable; + typedef std::function&)> GetImageTranslateAsyncHandler; + typedef Outcome GetTitleDiagnoseOutcome; + typedef std::future GetTitleDiagnoseOutcomeCallable; + typedef std::function&)> GetTitleDiagnoseAsyncHandler; + typedef Outcome GetTitleGenerateOutcome; + typedef std::future GetTitleGenerateOutcomeCallable; + typedef std::function&)> GetTitleGenerateAsyncHandler; typedef Outcome TranslateOutcome; typedef std::future TranslateOutcomeCallable; typedef std::function&)> TranslateAsyncHandler; @@ -80,6 +100,18 @@ namespace AlibabaCloud GetDocTranslateTaskOutcome getDocTranslateTask(const Model::GetDocTranslateTaskRequest &request)const; void getDocTranslateTaskAsync(const Model::GetDocTranslateTaskRequest& request, const GetDocTranslateTaskAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; GetDocTranslateTaskOutcomeCallable getDocTranslateTaskCallable(const Model::GetDocTranslateTaskRequest& request) const; + GetImageDiagnoseOutcome getImageDiagnose(const Model::GetImageDiagnoseRequest &request)const; + void getImageDiagnoseAsync(const Model::GetImageDiagnoseRequest& request, const GetImageDiagnoseAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetImageDiagnoseOutcomeCallable getImageDiagnoseCallable(const Model::GetImageDiagnoseRequest& request) const; + GetImageTranslateOutcome getImageTranslate(const Model::GetImageTranslateRequest &request)const; + void getImageTranslateAsync(const Model::GetImageTranslateRequest& request, const GetImageTranslateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetImageTranslateOutcomeCallable getImageTranslateCallable(const Model::GetImageTranslateRequest& request) const; + GetTitleDiagnoseOutcome getTitleDiagnose(const Model::GetTitleDiagnoseRequest &request)const; + void getTitleDiagnoseAsync(const Model::GetTitleDiagnoseRequest& request, const GetTitleDiagnoseAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetTitleDiagnoseOutcomeCallable getTitleDiagnoseCallable(const Model::GetTitleDiagnoseRequest& request) const; + GetTitleGenerateOutcome getTitleGenerate(const Model::GetTitleGenerateRequest &request)const; + void getTitleGenerateAsync(const Model::GetTitleGenerateRequest& request, const GetTitleGenerateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; + GetTitleGenerateOutcomeCallable getTitleGenerateCallable(const Model::GetTitleGenerateRequest& request) const; TranslateOutcome translate(const Model::TranslateRequest &request)const; void translateAsync(const Model::TranslateRequest& request, const TranslateAsyncHandler& handler, const std::shared_ptr& context = nullptr) const; TranslateOutcomeCallable translateCallable(const Model::TranslateRequest& request) const; diff --git a/alimt/include/alibabacloud/alimt/model/GetImageDiagnoseRequest.h b/alimt/include/alibabacloud/alimt/model/GetImageDiagnoseRequest.h new file mode 100644 index 000000000..abc083c87 --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetImageDiagnoseRequest.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ALIMT_MODEL_GETIMAGEDIAGNOSEREQUEST_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETIMAGEDIAGNOSEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetImageDiagnoseRequest : public RpcServiceRequest + { + + public: + GetImageDiagnoseRequest(); + ~GetImageDiagnoseRequest(); + + std::string getUrl()const; + void setUrl(const std::string& url); + std::string getExtra()const; + void setExtra(const std::string& extra); + + private: + std::string url_; + std::string extra_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETIMAGEDIAGNOSEREQUEST_H_ \ No newline at end of file diff --git a/alimt/include/alibabacloud/alimt/model/GetImageDiagnoseResult.h b/alimt/include/alibabacloud/alimt/model/GetImageDiagnoseResult.h new file mode 100644 index 000000000..733188321 --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetImageDiagnoseResult.h @@ -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_ALIMT_MODEL_GETIMAGEDIAGNOSERESULT_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETIMAGEDIAGNOSERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetImageDiagnoseResult : public ServiceResult + { + public: + struct Data + { + std::string language; + }; + + + GetImageDiagnoseResult(); + explicit GetImageDiagnoseResult(const std::string &payload); + ~GetImageDiagnoseResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETIMAGEDIAGNOSERESULT_H_ \ No newline at end of file diff --git a/alimt/include/alibabacloud/alimt/model/GetImageTranslateRequest.h b/alimt/include/alibabacloud/alimt/model/GetImageTranslateRequest.h new file mode 100644 index 000000000..607afb212 --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetImageTranslateRequest.h @@ -0,0 +1,57 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATEREQUEST_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetImageTranslateRequest : public RpcServiceRequest + { + + public: + GetImageTranslateRequest(); + ~GetImageTranslateRequest(); + + std::string getSourceLanguage()const; + void setSourceLanguage(const std::string& sourceLanguage); + std::string getUrl()const; + void setUrl(const std::string& url); + std::string getExtra()const; + void setExtra(const std::string& extra); + std::string getTargetLanguage()const; + void setTargetLanguage(const std::string& targetLanguage); + + private: + std::string sourceLanguage_; + std::string url_; + std::string extra_; + std::string targetLanguage_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATEREQUEST_H_ \ No newline at end of file diff --git a/alimt/include/alibabacloud/alimt/model/GetImageTranslateResult.h b/alimt/include/alibabacloud/alimt/model/GetImageTranslateResult.h new file mode 100644 index 000000000..9cbe15cfd --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetImageTranslateResult.h @@ -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_ALIMT_MODEL_GETIMAGETRANSLATERESULT_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetImageTranslateResult : public ServiceResult + { + public: + struct Data + { + std::string url; + }; + + + GetImageTranslateResult(); + explicit GetImageTranslateResult(const std::string &payload); + ~GetImageTranslateResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETIMAGETRANSLATERESULT_H_ \ No newline at end of file diff --git a/alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseRequest.h b/alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseRequest.h new file mode 100644 index 000000000..18d007ca6 --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseRequest.h @@ -0,0 +1,60 @@ +/* + * 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_ALIMT_MODEL_GETTITLEDIAGNOSEREQUEST_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETTITLEDIAGNOSEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetTitleDiagnoseRequest : public RpcServiceRequest + { + + public: + GetTitleDiagnoseRequest(); + ~GetTitleDiagnoseRequest(); + + std::string getLanguage()const; + void setLanguage(const std::string& language); + std::string getTitle()const; + void setTitle(const std::string& title); + std::string getPlatform()const; + void setPlatform(const std::string& platform); + std::string getExtra()const; + void setExtra(const std::string& extra); + std::string getCategoryId()const; + void setCategoryId(const std::string& categoryId); + + private: + std::string language_; + std::string title_; + std::string platform_; + std::string extra_; + std::string categoryId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETTITLEDIAGNOSEREQUEST_H_ \ No newline at end of file diff --git a/alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseResult.h b/alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseResult.h new file mode 100644 index 000000000..1bce6d2de --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetTitleDiagnoseResult.h @@ -0,0 +1,68 @@ +/* + * 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_ALIMT_MODEL_GETTITLEDIAGNOSERESULT_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETTITLEDIAGNOSERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetTitleDiagnoseResult : public ServiceResult + { + public: + struct Data + { + std::string noFirstUppercaseList; + std::string containCoreClasses; + std::string disableWords; + std::string wordCount; + std::string overLengthLimit; + std::string totalScore; + std::string duplicateWords; + std::string wordSpelledCorrectError; + std::string allUppercaseWords; + std::string languageQualityScore; + }; + + + GetTitleDiagnoseResult(); + explicit GetTitleDiagnoseResult(const std::string &payload); + ~GetTitleDiagnoseResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETTITLEDIAGNOSERESULT_H_ \ No newline at end of file diff --git a/alimt/include/alibabacloud/alimt/model/GetTitleGenerateRequest.h b/alimt/include/alibabacloud/alimt/model/GetTitleGenerateRequest.h new file mode 100644 index 000000000..e3eee9621 --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetTitleGenerateRequest.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_ALIMT_MODEL_GETTITLEGENERATEREQUEST_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETTITLEGENERATEREQUEST_H_ + +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetTitleGenerateRequest : public RpcServiceRequest + { + + public: + GetTitleGenerateRequest(); + ~GetTitleGenerateRequest(); + + std::string getLanguage()const; + void setLanguage(const std::string& language); + std::string getTitle()const; + void setTitle(const std::string& title); + std::string getPlatform()const; + void setPlatform(const std::string& platform); + std::string getExtra()const; + void setExtra(const std::string& extra); + std::string getAttributes()const; + void setAttributes(const std::string& attributes); + std::string getHotWords()const; + void setHotWords(const std::string& hotWords); + std::string getCategoryId()const; + void setCategoryId(const std::string& categoryId); + + private: + std::string language_; + std::string title_; + std::string platform_; + std::string extra_; + std::string attributes_; + std::string hotWords_; + std::string categoryId_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETTITLEGENERATEREQUEST_H_ \ No newline at end of file diff --git a/alimt/include/alibabacloud/alimt/model/GetTitleGenerateResult.h b/alimt/include/alibabacloud/alimt/model/GetTitleGenerateResult.h new file mode 100644 index 000000000..b279b879c --- /dev/null +++ b/alimt/include/alibabacloud/alimt/model/GetTitleGenerateResult.h @@ -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_ALIMT_MODEL_GETTITLEGENERATERESULT_H_ +#define ALIBABACLOUD_ALIMT_MODEL_GETTITLEGENERATERESULT_H_ + +#include +#include +#include +#include +#include + +namespace AlibabaCloud +{ + namespace Alimt + { + namespace Model + { + class ALIBABACLOUD_ALIMT_EXPORT GetTitleGenerateResult : public ServiceResult + { + public: + struct Data + { + std::string titles; + }; + + + GetTitleGenerateResult(); + explicit GetTitleGenerateResult(const std::string &payload); + ~GetTitleGenerateResult(); + std::string getMessage()const; + Data getData()const; + int getCode()const; + + protected: + void parse(const std::string &payload); + private: + std::string message_; + Data data_; + int code_; + + }; + } + } +} +#endif // !ALIBABACLOUD_ALIMT_MODEL_GETTITLEGENERATERESULT_H_ \ No newline at end of file diff --git a/alimt/src/AlimtClient.cc b/alimt/src/AlimtClient.cc index f84055df0..d94c6715b 100644 --- a/alimt/src/AlimtClient.cc +++ b/alimt/src/AlimtClient.cc @@ -31,21 +31,21 @@ AlimtClient::AlimtClient(const Credentials &credentials, const ClientConfigurati RpcServiceClient(SERVICE_NAME, std::make_shared(credentials), configuration) { auto locationClient = std::make_shared(credentials, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "alimt"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } AlimtClient::AlimtClient(const std::shared_ptr& credentialsProvider, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration) { auto locationClient = std::make_shared(credentialsProvider, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "alimt"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } AlimtClient::AlimtClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) : RpcServiceClient(SERVICE_NAME, std::make_shared(accessKeyId, accessKeySecret), configuration) { auto locationClient = std::make_shared(accessKeyId, accessKeySecret, configuration); - endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, "alimt"); + endpointProvider_ = std::make_shared(locationClient, configuration.regionId(), SERVICE_NAME, ""); } AlimtClient::~AlimtClient() @@ -159,6 +159,150 @@ AlimtClient::GetDocTranslateTaskOutcomeCallable AlimtClient::getDocTranslateTask return task->get_future(); } +AlimtClient::GetImageDiagnoseOutcome AlimtClient::getImageDiagnose(const GetImageDiagnoseRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetImageDiagnoseOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetImageDiagnoseOutcome(GetImageDiagnoseResult(outcome.result())); + else + return GetImageDiagnoseOutcome(outcome.error()); +} + +void AlimtClient::getImageDiagnoseAsync(const GetImageDiagnoseRequest& request, const GetImageDiagnoseAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getImageDiagnose(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AlimtClient::GetImageDiagnoseOutcomeCallable AlimtClient::getImageDiagnoseCallable(const GetImageDiagnoseRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getImageDiagnose(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AlimtClient::GetImageTranslateOutcome AlimtClient::getImageTranslate(const GetImageTranslateRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetImageTranslateOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetImageTranslateOutcome(GetImageTranslateResult(outcome.result())); + else + return GetImageTranslateOutcome(outcome.error()); +} + +void AlimtClient::getImageTranslateAsync(const GetImageTranslateRequest& request, const GetImageTranslateAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getImageTranslate(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AlimtClient::GetImageTranslateOutcomeCallable AlimtClient::getImageTranslateCallable(const GetImageTranslateRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getImageTranslate(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AlimtClient::GetTitleDiagnoseOutcome AlimtClient::getTitleDiagnose(const GetTitleDiagnoseRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetTitleDiagnoseOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetTitleDiagnoseOutcome(GetTitleDiagnoseResult(outcome.result())); + else + return GetTitleDiagnoseOutcome(outcome.error()); +} + +void AlimtClient::getTitleDiagnoseAsync(const GetTitleDiagnoseRequest& request, const GetTitleDiagnoseAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getTitleDiagnose(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AlimtClient::GetTitleDiagnoseOutcomeCallable AlimtClient::getTitleDiagnoseCallable(const GetTitleDiagnoseRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getTitleDiagnose(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + +AlimtClient::GetTitleGenerateOutcome AlimtClient::getTitleGenerate(const GetTitleGenerateRequest &request) const +{ + auto endpointOutcome = endpointProvider_->getEndpoint(); + if (!endpointOutcome.isSuccess()) + return GetTitleGenerateOutcome(endpointOutcome.error()); + + auto outcome = makeRequest(endpointOutcome.result(), request); + + if (outcome.isSuccess()) + return GetTitleGenerateOutcome(GetTitleGenerateResult(outcome.result())); + else + return GetTitleGenerateOutcome(outcome.error()); +} + +void AlimtClient::getTitleGenerateAsync(const GetTitleGenerateRequest& request, const GetTitleGenerateAsyncHandler& handler, const std::shared_ptr& context) const +{ + auto fn = [this, request, handler, context]() + { + handler(this, request, getTitleGenerate(request), context); + }; + + asyncExecute(new Runnable(fn)); +} + +AlimtClient::GetTitleGenerateOutcomeCallable AlimtClient::getTitleGenerateCallable(const GetTitleGenerateRequest &request) const +{ + auto task = std::make_shared>( + [this, request]() + { + return this->getTitleGenerate(request); + }); + + asyncExecute(new Runnable([task]() { (*task)(); })); + return task->get_future(); +} + AlimtClient::TranslateOutcome AlimtClient::translate(const TranslateRequest &request) const { auto endpointOutcome = endpointProvider_->getEndpoint(); diff --git a/alimt/src/model/GetImageDiagnoseRequest.cc b/alimt/src/model/GetImageDiagnoseRequest.cc new file mode 100644 index 000000000..8eafcb6b0 --- /dev/null +++ b/alimt/src/model/GetImageDiagnoseRequest.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Alimt::Model::GetImageDiagnoseRequest; + +GetImageDiagnoseRequest::GetImageDiagnoseRequest() : + RpcServiceRequest("alimt", "2018-10-12", "GetImageDiagnose") +{ + setMethod(HttpRequest::Method::Post); +} + +GetImageDiagnoseRequest::~GetImageDiagnoseRequest() +{} + +std::string GetImageDiagnoseRequest::getUrl()const +{ + return url_; +} + +void GetImageDiagnoseRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + +std::string GetImageDiagnoseRequest::getExtra()const +{ + return extra_; +} + +void GetImageDiagnoseRequest::setExtra(const std::string& extra) +{ + extra_ = extra; + setBodyParameter("Extra", extra); +} + diff --git a/alimt/src/model/GetImageDiagnoseResult.cc b/alimt/src/model/GetImageDiagnoseResult.cc new file mode 100644 index 000000000..2f6a62176 --- /dev/null +++ b/alimt/src/model/GetImageDiagnoseResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Alimt; +using namespace AlibabaCloud::Alimt::Model; + +GetImageDiagnoseResult::GetImageDiagnoseResult() : + ServiceResult() +{} + +GetImageDiagnoseResult::GetImageDiagnoseResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetImageDiagnoseResult::~GetImageDiagnoseResult() +{} + +void GetImageDiagnoseResult::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["Language"].isNull()) + data_.language = dataNode["Language"].asString(); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GetImageDiagnoseResult::getMessage()const +{ + return message_; +} + +GetImageDiagnoseResult::Data GetImageDiagnoseResult::getData()const +{ + return data_; +} + +int GetImageDiagnoseResult::getCode()const +{ + return code_; +} + diff --git a/alimt/src/model/GetImageTranslateRequest.cc b/alimt/src/model/GetImageTranslateRequest.cc new file mode 100644 index 000000000..6fcb4f7b4 --- /dev/null +++ b/alimt/src/model/GetImageTranslateRequest.cc @@ -0,0 +1,73 @@ +/* + * Copyright 2009-2017 Alibaba Cloud All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +using AlibabaCloud::Alimt::Model::GetImageTranslateRequest; + +GetImageTranslateRequest::GetImageTranslateRequest() : + RpcServiceRequest("alimt", "2018-10-12", "GetImageTranslate") +{ + setMethod(HttpRequest::Method::Post); +} + +GetImageTranslateRequest::~GetImageTranslateRequest() +{} + +std::string GetImageTranslateRequest::getSourceLanguage()const +{ + return sourceLanguage_; +} + +void GetImageTranslateRequest::setSourceLanguage(const std::string& sourceLanguage) +{ + sourceLanguage_ = sourceLanguage; + setBodyParameter("SourceLanguage", sourceLanguage); +} + +std::string GetImageTranslateRequest::getUrl()const +{ + return url_; +} + +void GetImageTranslateRequest::setUrl(const std::string& url) +{ + url_ = url; + setBodyParameter("Url", url); +} + +std::string GetImageTranslateRequest::getExtra()const +{ + return extra_; +} + +void GetImageTranslateRequest::setExtra(const std::string& extra) +{ + extra_ = extra; + setBodyParameter("Extra", extra); +} + +std::string GetImageTranslateRequest::getTargetLanguage()const +{ + return targetLanguage_; +} + +void GetImageTranslateRequest::setTargetLanguage(const std::string& targetLanguage) +{ + targetLanguage_ = targetLanguage; + setBodyParameter("TargetLanguage", targetLanguage); +} + diff --git a/alimt/src/model/GetImageTranslateResult.cc b/alimt/src/model/GetImageTranslateResult.cc new file mode 100644 index 000000000..ec8b883da --- /dev/null +++ b/alimt/src/model/GetImageTranslateResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Alimt; +using namespace AlibabaCloud::Alimt::Model; + +GetImageTranslateResult::GetImageTranslateResult() : + ServiceResult() +{} + +GetImageTranslateResult::GetImageTranslateResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetImageTranslateResult::~GetImageTranslateResult() +{} + +void GetImageTranslateResult::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["Url"].isNull()) + data_.url = dataNode["Url"].asString(); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GetImageTranslateResult::getMessage()const +{ + return message_; +} + +GetImageTranslateResult::Data GetImageTranslateResult::getData()const +{ + return data_; +} + +int GetImageTranslateResult::getCode()const +{ + return code_; +} + diff --git a/alimt/src/model/GetTitleDiagnoseRequest.cc b/alimt/src/model/GetTitleDiagnoseRequest.cc new file mode 100644 index 000000000..e2708dc35 --- /dev/null +++ b/alimt/src/model/GetTitleDiagnoseRequest.cc @@ -0,0 +1,84 @@ +/* + * 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 + +using AlibabaCloud::Alimt::Model::GetTitleDiagnoseRequest; + +GetTitleDiagnoseRequest::GetTitleDiagnoseRequest() : + RpcServiceRequest("alimt", "2018-10-12", "GetTitleDiagnose") +{ + setMethod(HttpRequest::Method::Post); +} + +GetTitleDiagnoseRequest::~GetTitleDiagnoseRequest() +{} + +std::string GetTitleDiagnoseRequest::getLanguage()const +{ + return language_; +} + +void GetTitleDiagnoseRequest::setLanguage(const std::string& language) +{ + language_ = language; + setBodyParameter("Language", language); +} + +std::string GetTitleDiagnoseRequest::getTitle()const +{ + return title_; +} + +void GetTitleDiagnoseRequest::setTitle(const std::string& title) +{ + title_ = title; + setBodyParameter("Title", title); +} + +std::string GetTitleDiagnoseRequest::getPlatform()const +{ + return platform_; +} + +void GetTitleDiagnoseRequest::setPlatform(const std::string& platform) +{ + platform_ = platform; + setBodyParameter("Platform", platform); +} + +std::string GetTitleDiagnoseRequest::getExtra()const +{ + return extra_; +} + +void GetTitleDiagnoseRequest::setExtra(const std::string& extra) +{ + extra_ = extra; + setBodyParameter("Extra", extra); +} + +std::string GetTitleDiagnoseRequest::getCategoryId()const +{ + return categoryId_; +} + +void GetTitleDiagnoseRequest::setCategoryId(const std::string& categoryId) +{ + categoryId_ = categoryId; + setBodyParameter("CategoryId", categoryId); +} + diff --git a/alimt/src/model/GetTitleDiagnoseResult.cc b/alimt/src/model/GetTitleDiagnoseResult.cc new file mode 100644 index 000000000..c208c1c33 --- /dev/null +++ b/alimt/src/model/GetTitleDiagnoseResult.cc @@ -0,0 +1,84 @@ +/* + * 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 +#include + +using namespace AlibabaCloud::Alimt; +using namespace AlibabaCloud::Alimt::Model; + +GetTitleDiagnoseResult::GetTitleDiagnoseResult() : + ServiceResult() +{} + +GetTitleDiagnoseResult::GetTitleDiagnoseResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetTitleDiagnoseResult::~GetTitleDiagnoseResult() +{} + +void GetTitleDiagnoseResult::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["ContainCoreClasses"].isNull()) + data_.containCoreClasses = dataNode["ContainCoreClasses"].asString(); + if(!dataNode["OverLengthLimit"].isNull()) + data_.overLengthLimit = dataNode["OverLengthLimit"].asString(); + if(!dataNode["WordSpelledCorrectError"].isNull()) + data_.wordSpelledCorrectError = dataNode["WordSpelledCorrectError"].asString(); + if(!dataNode["AllUppercaseWords"].isNull()) + data_.allUppercaseWords = dataNode["AllUppercaseWords"].asString(); + if(!dataNode["NoFirstUppercaseList"].isNull()) + data_.noFirstUppercaseList = dataNode["NoFirstUppercaseList"].asString(); + if(!dataNode["DuplicateWords"].isNull()) + data_.duplicateWords = dataNode["DuplicateWords"].asString(); + if(!dataNode["DisableWords"].isNull()) + data_.disableWords = dataNode["DisableWords"].asString(); + if(!dataNode["WordCount"].isNull()) + data_.wordCount = dataNode["WordCount"].asString(); + if(!dataNode["TotalScore"].isNull()) + data_.totalScore = dataNode["TotalScore"].asString(); + if(!dataNode["LanguageQualityScore"].isNull()) + data_.languageQualityScore = dataNode["LanguageQualityScore"].asString(); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GetTitleDiagnoseResult::getMessage()const +{ + return message_; +} + +GetTitleDiagnoseResult::Data GetTitleDiagnoseResult::getData()const +{ + return data_; +} + +int GetTitleDiagnoseResult::getCode()const +{ + return code_; +} + diff --git a/alimt/src/model/GetTitleGenerateRequest.cc b/alimt/src/model/GetTitleGenerateRequest.cc new file mode 100644 index 000000000..0734a76de --- /dev/null +++ b/alimt/src/model/GetTitleGenerateRequest.cc @@ -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 + +using AlibabaCloud::Alimt::Model::GetTitleGenerateRequest; + +GetTitleGenerateRequest::GetTitleGenerateRequest() : + RpcServiceRequest("alimt", "2018-10-12", "GetTitleGenerate") +{ + setMethod(HttpRequest::Method::Post); +} + +GetTitleGenerateRequest::~GetTitleGenerateRequest() +{} + +std::string GetTitleGenerateRequest::getLanguage()const +{ + return language_; +} + +void GetTitleGenerateRequest::setLanguage(const std::string& language) +{ + language_ = language; + setBodyParameter("Language", language); +} + +std::string GetTitleGenerateRequest::getTitle()const +{ + return title_; +} + +void GetTitleGenerateRequest::setTitle(const std::string& title) +{ + title_ = title; + setBodyParameter("Title", title); +} + +std::string GetTitleGenerateRequest::getPlatform()const +{ + return platform_; +} + +void GetTitleGenerateRequest::setPlatform(const std::string& platform) +{ + platform_ = platform; + setBodyParameter("Platform", platform); +} + +std::string GetTitleGenerateRequest::getExtra()const +{ + return extra_; +} + +void GetTitleGenerateRequest::setExtra(const std::string& extra) +{ + extra_ = extra; + setBodyParameter("Extra", extra); +} + +std::string GetTitleGenerateRequest::getAttributes()const +{ + return attributes_; +} + +void GetTitleGenerateRequest::setAttributes(const std::string& attributes) +{ + attributes_ = attributes; + setBodyParameter("Attributes", attributes); +} + +std::string GetTitleGenerateRequest::getHotWords()const +{ + return hotWords_; +} + +void GetTitleGenerateRequest::setHotWords(const std::string& hotWords) +{ + hotWords_ = hotWords; + setBodyParameter("HotWords", hotWords); +} + +std::string GetTitleGenerateRequest::getCategoryId()const +{ + return categoryId_; +} + +void GetTitleGenerateRequest::setCategoryId(const std::string& categoryId) +{ + categoryId_ = categoryId; + setBodyParameter("CategoryId", categoryId); +} + diff --git a/alimt/src/model/GetTitleGenerateResult.cc b/alimt/src/model/GetTitleGenerateResult.cc new file mode 100644 index 000000000..4f9671a3c --- /dev/null +++ b/alimt/src/model/GetTitleGenerateResult.cc @@ -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 +#include + +using namespace AlibabaCloud::Alimt; +using namespace AlibabaCloud::Alimt::Model; + +GetTitleGenerateResult::GetTitleGenerateResult() : + ServiceResult() +{} + +GetTitleGenerateResult::GetTitleGenerateResult(const std::string &payload) : + ServiceResult() +{ + parse(payload); +} + +GetTitleGenerateResult::~GetTitleGenerateResult() +{} + +void GetTitleGenerateResult::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["Titles"].isNull()) + data_.titles = dataNode["Titles"].asString(); + if(!value["Code"].isNull()) + code_ = std::stoi(value["Code"].asString()); + if(!value["Message"].isNull()) + message_ = value["Message"].asString(); + +} + +std::string GetTitleGenerateResult::getMessage()const +{ + return message_; +} + +GetTitleGenerateResult::Data GetTitleGenerateResult::getData()const +{ + return data_; +} + +int GetTitleGenerateResult::getCode()const +{ + return code_; +} +