Browse Source

add FindUserReport4Alinlp Api.

sdk-team 3 years ago
parent
commit
2f207f2248

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1495
+1.36.1496

+ 4 - 0
nlp-automl/CMakeLists.txt

@@ -23,6 +23,8 @@ set(nlp-automl_public_header
 set(nlp-automl_public_header_model 
 	include/alibabacloud/nlp-automl/model/CreateAsyncPredictRequest.h
 	include/alibabacloud/nlp-automl/model/CreateAsyncPredictResult.h
+	include/alibabacloud/nlp-automl/model/FindUserReport4AlinlpRequest.h
+	include/alibabacloud/nlp-automl/model/FindUserReport4AlinlpResult.h
 	include/alibabacloud/nlp-automl/model/GetAsyncPredictRequest.h
 	include/alibabacloud/nlp-automl/model/GetAsyncPredictResult.h
 	include/alibabacloud/nlp-automl/model/GetPredictResultRequest.h
@@ -34,6 +36,8 @@ set(nlp-automl_src
 	src/Nlp-automlClient.cc
 	src/model/CreateAsyncPredictRequest.cc
 	src/model/CreateAsyncPredictResult.cc
+	src/model/FindUserReport4AlinlpRequest.cc
+	src/model/FindUserReport4AlinlpResult.cc
 	src/model/GetAsyncPredictRequest.cc
 	src/model/GetAsyncPredictResult.cc
 	src/model/GetPredictResultRequest.cc

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

@@ -24,6 +24,8 @@
 #include "Nlp_automlExport.h"
 #include "model/CreateAsyncPredictRequest.h"
 #include "model/CreateAsyncPredictResult.h"
+#include "model/FindUserReport4AlinlpRequest.h"
+#include "model/FindUserReport4AlinlpResult.h"
 #include "model/GetAsyncPredictRequest.h"
 #include "model/GetAsyncPredictResult.h"
 #include "model/GetPredictResultRequest.h"
@@ -42,6 +44,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::CreateAsyncPredictResult> CreateAsyncPredictOutcome;
 			typedef std::future<CreateAsyncPredictOutcome> CreateAsyncPredictOutcomeCallable;
 			typedef std::function<void(const Nlp_automlClient*, const Model::CreateAsyncPredictRequest&, const CreateAsyncPredictOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateAsyncPredictAsyncHandler;
+			typedef Outcome<Error, Model::FindUserReport4AlinlpResult> FindUserReport4AlinlpOutcome;
+			typedef std::future<FindUserReport4AlinlpOutcome> FindUserReport4AlinlpOutcomeCallable;
+			typedef std::function<void(const Nlp_automlClient*, const Model::FindUserReport4AlinlpRequest&, const FindUserReport4AlinlpOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> FindUserReport4AlinlpAsyncHandler;
 			typedef Outcome<Error, Model::GetAsyncPredictResult> GetAsyncPredictOutcome;
 			typedef std::future<GetAsyncPredictOutcome> GetAsyncPredictOutcomeCallable;
 			typedef std::function<void(const Nlp_automlClient*, const Model::GetAsyncPredictRequest&, const GetAsyncPredictOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> GetAsyncPredictAsyncHandler;
@@ -59,6 +64,9 @@ namespace AlibabaCloud
 			CreateAsyncPredictOutcome createAsyncPredict(const Model::CreateAsyncPredictRequest &request)const;
 			void createAsyncPredictAsync(const Model::CreateAsyncPredictRequest& request, const CreateAsyncPredictAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			CreateAsyncPredictOutcomeCallable createAsyncPredictCallable(const Model::CreateAsyncPredictRequest& request) const;
+			FindUserReport4AlinlpOutcome findUserReport4Alinlp(const Model::FindUserReport4AlinlpRequest &request)const;
+			void findUserReport4AlinlpAsync(const Model::FindUserReport4AlinlpRequest& request, const FindUserReport4AlinlpAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			FindUserReport4AlinlpOutcomeCallable findUserReport4AlinlpCallable(const Model::FindUserReport4AlinlpRequest& request) const;
 			GetAsyncPredictOutcome getAsyncPredict(const Model::GetAsyncPredictRequest &request)const;
 			void getAsyncPredictAsync(const Model::GetAsyncPredictRequest& request, const GetAsyncPredictAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			GetAsyncPredictOutcomeCallable getAsyncPredictCallable(const Model::GetAsyncPredictRequest& request) const;

+ 54 - 0
nlp-automl/include/alibabacloud/nlp-automl/model/FindUserReport4AlinlpRequest.h

@@ -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_NLP_AUTOML_MODEL_FINDUSERREPORT4ALINLPREQUEST_H_
+#define ALIBABACLOUD_NLP_AUTOML_MODEL_FINDUSERREPORT4ALINLPREQUEST_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 FindUserReport4AlinlpRequest : public RpcServiceRequest {
+public:
+	FindUserReport4AlinlpRequest();
+	~FindUserReport4AlinlpRequest();
+	long getCustomerUserParentId() const;
+	void setCustomerUserParentId(long customerUserParentId);
+	std::string getEndTime() const;
+	void setEndTime(const std::string &endTime);
+	std::string getBeginTime() const;
+	void setBeginTime(const std::string &beginTime);
+	std::string getType() const;
+	void setType(const std::string &type);
+	std::string getModelType() const;
+	void setModelType(const std::string &modelType);
+
+private:
+	long customerUserParentId_;
+	std::string endTime_;
+	std::string beginTime_;
+	std::string type_;
+	std::string modelType_;
+};
+} // namespace Model
+} // namespace Nlp_automl
+} // namespace AlibabaCloud
+#endif // !ALIBABACLOUD_NLP_AUTOML_MODEL_FINDUSERREPORT4ALINLPREQUEST_H_

+ 61 - 0
nlp-automl/include/alibabacloud/nlp-automl/model/FindUserReport4AlinlpResult.h

@@ -0,0 +1,61 @@
+/*
+ * 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_FINDUSERREPORT4ALINLPRESULT_H_
+#define ALIBABACLOUD_NLP_AUTOML_MODEL_FINDUSERREPORT4ALINLPRESULT_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 FindUserReport4AlinlpResult : public ServiceResult
+			{
+			public:
+				struct Report
+				{
+					long totalCount;
+					long failCount;
+					int qpsMax;
+					std::string rptTime;
+					long successCount;
+				};
+
+
+				FindUserReport4AlinlpResult();
+				explicit FindUserReport4AlinlpResult(const std::string &payload);
+				~FindUserReport4AlinlpResult();
+				std::vector<Report> getData()const;
+				std::string getCode()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::vector<Report> data_;
+				std::string code_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_NLP_AUTOML_MODEL_FINDUSERREPORT4ALINLPRESULT_H_

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

@@ -87,6 +87,42 @@ Nlp_automlClient::CreateAsyncPredictOutcomeCallable Nlp_automlClient::createAsyn
 	return task->get_future();
 }
 
+Nlp_automlClient::FindUserReport4AlinlpOutcome Nlp_automlClient::findUserReport4Alinlp(const FindUserReport4AlinlpRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return FindUserReport4AlinlpOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return FindUserReport4AlinlpOutcome(FindUserReport4AlinlpResult(outcome.result()));
+	else
+		return FindUserReport4AlinlpOutcome(outcome.error());
+}
+
+void Nlp_automlClient::findUserReport4AlinlpAsync(const FindUserReport4AlinlpRequest& request, const FindUserReport4AlinlpAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, findUserReport4Alinlp(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+Nlp_automlClient::FindUserReport4AlinlpOutcomeCallable Nlp_automlClient::findUserReport4AlinlpCallable(const FindUserReport4AlinlpRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<FindUserReport4AlinlpOutcome()>>(
+			[this, request]()
+			{
+			return this->findUserReport4Alinlp(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 Nlp_automlClient::GetAsyncPredictOutcome Nlp_automlClient::getAsyncPredict(const GetAsyncPredictRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 72 - 0
nlp-automl/src/model/FindUserReport4AlinlpRequest.cc

@@ -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.
+ */
+
+#include <alibabacloud/nlp-automl/model/FindUserReport4AlinlpRequest.h>
+
+using AlibabaCloud::Nlp_automl::Model::FindUserReport4AlinlpRequest;
+
+FindUserReport4AlinlpRequest::FindUserReport4AlinlpRequest()
+    : RpcServiceRequest("nlp-automl", "2019-11-11", "FindUserReport4Alinlp") {
+  setMethod(HttpRequest::Method::Post);
+}
+
+FindUserReport4AlinlpRequest::~FindUserReport4AlinlpRequest() {}
+
+long FindUserReport4AlinlpRequest::getCustomerUserParentId() const {
+  return customerUserParentId_;
+}
+
+void FindUserReport4AlinlpRequest::setCustomerUserParentId(long customerUserParentId) {
+  customerUserParentId_ = customerUserParentId;
+  setBodyParameter(std::string("CustomerUserParentId"), std::to_string(customerUserParentId));
+}
+
+std::string FindUserReport4AlinlpRequest::getEndTime() const {
+  return endTime_;
+}
+
+void FindUserReport4AlinlpRequest::setEndTime(const std::string &endTime) {
+  endTime_ = endTime;
+  setBodyParameter(std::string("EndTime"), endTime);
+}
+
+std::string FindUserReport4AlinlpRequest::getBeginTime() const {
+  return beginTime_;
+}
+
+void FindUserReport4AlinlpRequest::setBeginTime(const std::string &beginTime) {
+  beginTime_ = beginTime;
+  setBodyParameter(std::string("BeginTime"), beginTime);
+}
+
+std::string FindUserReport4AlinlpRequest::getType() const {
+  return type_;
+}
+
+void FindUserReport4AlinlpRequest::setType(const std::string &type) {
+  type_ = type;
+  setBodyParameter(std::string("Type"), type);
+}
+
+std::string FindUserReport4AlinlpRequest::getModelType() const {
+  return modelType_;
+}
+
+void FindUserReport4AlinlpRequest::setModelType(const std::string &modelType) {
+  modelType_ = modelType;
+  setBodyParameter(std::string("ModelType"), modelType);
+}
+

+ 72 - 0
nlp-automl/src/model/FindUserReport4AlinlpResult.cc

@@ -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.
+ */
+
+#include <alibabacloud/nlp-automl/model/FindUserReport4AlinlpResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Nlp_automl;
+using namespace AlibabaCloud::Nlp_automl::Model;
+
+FindUserReport4AlinlpResult::FindUserReport4AlinlpResult() :
+	ServiceResult()
+{}
+
+FindUserReport4AlinlpResult::FindUserReport4AlinlpResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+FindUserReport4AlinlpResult::~FindUserReport4AlinlpResult()
+{}
+
+void FindUserReport4AlinlpResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto allDataNode = value["Data"]["report"];
+	for (auto valueDatareport : allDataNode)
+	{
+		Report dataObject;
+		if(!valueDatareport["TotalCount"].isNull())
+			dataObject.totalCount = std::stol(valueDatareport["TotalCount"].asString());
+		if(!valueDatareport["SuccessCount"].isNull())
+			dataObject.successCount = std::stol(valueDatareport["SuccessCount"].asString());
+		if(!valueDatareport["FailCount"].isNull())
+			dataObject.failCount = std::stol(valueDatareport["FailCount"].asString());
+		if(!valueDatareport["QpsMax"].isNull())
+			dataObject.qpsMax = std::stoi(valueDatareport["QpsMax"].asString());
+		if(!valueDatareport["RptTime"].isNull())
+			dataObject.rptTime = valueDatareport["RptTime"].asString();
+		data_.push_back(dataObject);
+	}
+	if(!value["Code"].isNull())
+		code_ = value["Code"].asString();
+
+}
+
+std::vector<FindUserReport4AlinlpResult::Report> FindUserReport4AlinlpResult::getData()const
+{
+	return data_;
+}
+
+std::string FindUserReport4AlinlpResult::getCode()const
+{
+	return code_;
+}
+