Răsfoiți Sursa

Add The billingCount return value to the RunPreTrainService Api.

sdk-team 3 ani în urmă
părinte
comite
43d1c945b8

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1625
+1.36.1626

+ 6 - 2
nlp-automl/CMakeLists.txt

@@ -30,7 +30,9 @@ set(nlp-automl_public_header_model
 	include/alibabacloud/nlp-automl/model/GetPredictResultRequest.h
 	include/alibabacloud/nlp-automl/model/GetPredictResultResult.h
 	include/alibabacloud/nlp-automl/model/RunPreTrainServiceRequest.h
-	include/alibabacloud/nlp-automl/model/RunPreTrainServiceResult.h )
+	include/alibabacloud/nlp-automl/model/RunPreTrainServiceResult.h
+	include/alibabacloud/nlp-automl/model/RunPreTrainServiceNewRequest.h
+	include/alibabacloud/nlp-automl/model/RunPreTrainServiceNewResult.h )
 
 set(nlp-automl_src 
 	src/Nlp-automlClient.cc
@@ -43,7 +45,9 @@ set(nlp-automl_src
 	src/model/GetPredictResultRequest.cc
 	src/model/GetPredictResultResult.cc
 	src/model/RunPreTrainServiceRequest.cc
-	src/model/RunPreTrainServiceResult.cc )
+	src/model/RunPreTrainServiceResult.cc
+	src/model/RunPreTrainServiceNewRequest.cc
+	src/model/RunPreTrainServiceNewResult.cc )
 
 add_library(nlp-automl ${LIB_TYPE}
 	${nlp-automl_public_header}

+ 8 - 0
nlp-automl/include/alibabacloud/nlp-automl/Nlp_automlClient.h

@@ -32,6 +32,8 @@
 #include "model/GetPredictResultResult.h"
 #include "model/RunPreTrainServiceRequest.h"
 #include "model/RunPreTrainServiceResult.h"
+#include "model/RunPreTrainServiceNewRequest.h"
+#include "model/RunPreTrainServiceNewResult.h"
 
 
 namespace AlibabaCloud
@@ -56,6 +58,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::RunPreTrainServiceResult> RunPreTrainServiceOutcome;
 			typedef std::future<RunPreTrainServiceOutcome> RunPreTrainServiceOutcomeCallable;
 			typedef std::function<void(const Nlp_automlClient*, const Model::RunPreTrainServiceRequest&, const RunPreTrainServiceOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RunPreTrainServiceAsyncHandler;
+			typedef Outcome<Error, Model::RunPreTrainServiceNewResult> RunPreTrainServiceNewOutcome;
+			typedef std::future<RunPreTrainServiceNewOutcome> RunPreTrainServiceNewOutcomeCallable;
+			typedef std::function<void(const Nlp_automlClient*, const Model::RunPreTrainServiceNewRequest&, const RunPreTrainServiceNewOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RunPreTrainServiceNewAsyncHandler;
 
 			Nlp_automlClient(const Credentials &credentials, const ClientConfiguration &configuration);
 			Nlp_automlClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
@@ -76,6 +81,9 @@ namespace AlibabaCloud
 			RunPreTrainServiceOutcome runPreTrainService(const Model::RunPreTrainServiceRequest &request)const;
 			void runPreTrainServiceAsync(const Model::RunPreTrainServiceRequest& request, const RunPreTrainServiceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			RunPreTrainServiceOutcomeCallable runPreTrainServiceCallable(const Model::RunPreTrainServiceRequest& request) const;
+			RunPreTrainServiceNewOutcome runPreTrainServiceNew(const Model::RunPreTrainServiceNewRequest &request)const;
+			void runPreTrainServiceNewAsync(const Model::RunPreTrainServiceNewRequest& request, const RunPreTrainServiceNewAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			RunPreTrainServiceNewOutcomeCallable runPreTrainServiceNewCallable(const Model::RunPreTrainServiceNewRequest& request) const;
 	
 		private:
 			std::shared_ptr<EndpointProvider> endpointProvider_;

+ 51 - 0
nlp-automl/include/alibabacloud/nlp-automl/model/RunPreTrainServiceNewRequest.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_NLP_AUTOML_MODEL_RUNPRETRAINSERVICENEWREQUEST_H_
+#define ALIBABACLOUD_NLP_AUTOML_MODEL_RUNPRETRAINSERVICENEWREQUEST_H_
+
+#include <alibabacloud/nlp-automl/Nlp_automlExport.h>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <string>
+#include <vector>
+#include <map>
+
+namespace AlibabaCloud {
+namespace Nlp_automl {
+namespace Model {
+class ALIBABACLOUD_NLP_AUTOML_EXPORT RunPreTrainServiceNewRequest : public RpcServiceRequest {
+public:
+	RunPreTrainServiceNewRequest();
+	~RunPreTrainServiceNewRequest();
+	std::string getProduct() const;
+	void setProduct(const std::string &product);
+	std::string getPredictContent() const;
+	void setPredictContent(const std::string &predictContent);
+	std::string getServiceVersion() const;
+	void setServiceVersion(const std::string &serviceVersion);
+	std::string getServiceName() const;
+	void setServiceName(const std::string &serviceName);
+
+private:
+	std::string product_;
+	std::string predictContent_;
+	std::string serviceVersion_;
+	std::string serviceName_;
+};
+} // namespace Model
+} // namespace Nlp_automl
+} // namespace AlibabaCloud
+#endif // !ALIBABACLOUD_NLP_AUTOML_MODEL_RUNPRETRAINSERVICENEWREQUEST_H_

+ 53 - 0
nlp-automl/include/alibabacloud/nlp-automl/model/RunPreTrainServiceNewResult.h

@@ -0,0 +1,53 @@
+/*
+ * 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_NLP_AUTOML_MODEL_RUNPRETRAINSERVICENEWRESULT_H_
+#define ALIBABACLOUD_NLP_AUTOML_MODEL_RUNPRETRAINSERVICENEWRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/nlp-automl/Nlp_automlExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Nlp_automl
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_NLP_AUTOML_EXPORT RunPreTrainServiceNewResult : public ServiceResult
+			{
+			public:
+
+
+				RunPreTrainServiceNewResult();
+				explicit RunPreTrainServiceNewResult(const std::string &payload);
+				~RunPreTrainServiceNewResult();
+				int getBillingCount()const;
+				std::string getPredictResult()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				int billingCount_;
+				std::string predictResult_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_NLP_AUTOML_MODEL_RUNPRETRAINSERVICENEWRESULT_H_

+ 36 - 0
nlp-automl/src/Nlp-automlClient.cc

@@ -231,3 +231,39 @@ Nlp_automlClient::RunPreTrainServiceOutcomeCallable Nlp_automlClient::runPreTrai
 	return task->get_future();
 }
 
+Nlp_automlClient::RunPreTrainServiceNewOutcome Nlp_automlClient::runPreTrainServiceNew(const RunPreTrainServiceNewRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return RunPreTrainServiceNewOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return RunPreTrainServiceNewOutcome(RunPreTrainServiceNewResult(outcome.result()));
+	else
+		return RunPreTrainServiceNewOutcome(outcome.error());
+}
+
+void Nlp_automlClient::runPreTrainServiceNewAsync(const RunPreTrainServiceNewRequest& request, const RunPreTrainServiceNewAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, runPreTrainServiceNew(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+Nlp_automlClient::RunPreTrainServiceNewOutcomeCallable Nlp_automlClient::runPreTrainServiceNewCallable(const RunPreTrainServiceNewRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<RunPreTrainServiceNewOutcome()>>(
+			[this, request]()
+			{
+			return this->runPreTrainServiceNew(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+

+ 63 - 0
nlp-automl/src/model/RunPreTrainServiceNewRequest.cc

@@ -0,0 +1,63 @@
+/*
+ * 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/nlp-automl/model/RunPreTrainServiceNewRequest.h>
+
+using AlibabaCloud::Nlp_automl::Model::RunPreTrainServiceNewRequest;
+
+RunPreTrainServiceNewRequest::RunPreTrainServiceNewRequest()
+    : RpcServiceRequest("nlp-automl", "2019-11-11", "RunPreTrainServiceNew") {
+  setMethod(HttpRequest::Method::Post);
+}
+
+RunPreTrainServiceNewRequest::~RunPreTrainServiceNewRequest() {}
+
+std::string RunPreTrainServiceNewRequest::getProduct() const {
+  return product_;
+}
+
+void RunPreTrainServiceNewRequest::setProduct(const std::string &product) {
+  product_ = product;
+  setBodyParameter(std::string("Product"), product);
+}
+
+std::string RunPreTrainServiceNewRequest::getPredictContent() const {
+  return predictContent_;
+}
+
+void RunPreTrainServiceNewRequest::setPredictContent(const std::string &predictContent) {
+  predictContent_ = predictContent;
+  setBodyParameter(std::string("PredictContent"), predictContent);
+}
+
+std::string RunPreTrainServiceNewRequest::getServiceVersion() const {
+  return serviceVersion_;
+}
+
+void RunPreTrainServiceNewRequest::setServiceVersion(const std::string &serviceVersion) {
+  serviceVersion_ = serviceVersion;
+  setBodyParameter(std::string("ServiceVersion"), serviceVersion);
+}
+
+std::string RunPreTrainServiceNewRequest::getServiceName() const {
+  return serviceName_;
+}
+
+void RunPreTrainServiceNewRequest::setServiceName(const std::string &serviceName) {
+  serviceName_ = serviceName;
+  setBodyParameter(std::string("ServiceName"), serviceName);
+}
+

+ 58 - 0
nlp-automl/src/model/RunPreTrainServiceNewResult.cc

@@ -0,0 +1,58 @@
+/*
+ * 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/nlp-automl/model/RunPreTrainServiceNewResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Nlp_automl;
+using namespace AlibabaCloud::Nlp_automl::Model;
+
+RunPreTrainServiceNewResult::RunPreTrainServiceNewResult() :
+	ServiceResult()
+{}
+
+RunPreTrainServiceNewResult::RunPreTrainServiceNewResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+RunPreTrainServiceNewResult::~RunPreTrainServiceNewResult()
+{}
+
+void RunPreTrainServiceNewResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	if(!value["PredictResult"].isNull())
+		predictResult_ = value["PredictResult"].asString();
+	if(!value["BillingCount"].isNull())
+		billingCount_ = std::stoi(value["BillingCount"].asString());
+
+}
+
+int RunPreTrainServiceNewResult::getBillingCount()const
+{
+	return billingCount_;
+}
+
+std::string RunPreTrainServiceNewResult::getPredictResult()const
+{
+	return predictResult_;
+}
+