Add api request parameters and error code.
This commit is contained in:
@@ -61,6 +61,8 @@ set(quickbi-public_public_header_model
|
||||
include/alibabacloud/quickbi-public/model/CreateTicket4CopilotResult.h
|
||||
include/alibabacloud/quickbi-public/model/CreateUserGroupRequest.h
|
||||
include/alibabacloud/quickbi-public/model/CreateUserGroupResult.h
|
||||
include/alibabacloud/quickbi-public/model/DataInterpretationRequest.h
|
||||
include/alibabacloud/quickbi-public/model/DataInterpretationResult.h
|
||||
include/alibabacloud/quickbi-public/model/DataSetBloodRequest.h
|
||||
include/alibabacloud/quickbi-public/model/DataSetBloodResult.h
|
||||
include/alibabacloud/quickbi-public/model/DataSourceBloodRequest.h
|
||||
@@ -290,6 +292,8 @@ set(quickbi-public_src
|
||||
src/model/CreateTicket4CopilotResult.cc
|
||||
src/model/CreateUserGroupRequest.cc
|
||||
src/model/CreateUserGroupResult.cc
|
||||
src/model/DataInterpretationRequest.cc
|
||||
src/model/DataInterpretationResult.cc
|
||||
src/model/DataSetBloodRequest.cc
|
||||
src/model/DataSetBloodResult.cc
|
||||
src/model/DataSourceBloodRequest.cc
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
#include "model/CreateTicket4CopilotResult.h"
|
||||
#include "model/CreateUserGroupRequest.h"
|
||||
#include "model/CreateUserGroupResult.h"
|
||||
#include "model/DataInterpretationRequest.h"
|
||||
#include "model/DataInterpretationResult.h"
|
||||
#include "model/DataSetBloodRequest.h"
|
||||
#include "model/DataSetBloodResult.h"
|
||||
#include "model/DataSourceBloodRequest.h"
|
||||
@@ -317,6 +319,9 @@ namespace AlibabaCloud
|
||||
typedef Outcome<Error, Model::CreateUserGroupResult> CreateUserGroupOutcome;
|
||||
typedef std::future<CreateUserGroupOutcome> CreateUserGroupOutcomeCallable;
|
||||
typedef std::function<void(const Quickbi_publicClient*, const Model::CreateUserGroupRequest&, const CreateUserGroupOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CreateUserGroupAsyncHandler;
|
||||
typedef Outcome<Error, Model::DataInterpretationResult> DataInterpretationOutcome;
|
||||
typedef std::future<DataInterpretationOutcome> DataInterpretationOutcomeCallable;
|
||||
typedef std::function<void(const Quickbi_publicClient*, const Model::DataInterpretationRequest&, const DataInterpretationOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DataInterpretationAsyncHandler;
|
||||
typedef Outcome<Error, Model::DataSetBloodResult> DataSetBloodOutcome;
|
||||
typedef std::future<DataSetBloodOutcome> DataSetBloodOutcomeCallable;
|
||||
typedef std::function<void(const Quickbi_publicClient*, const Model::DataSetBloodRequest&, const DataSetBloodOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DataSetBloodAsyncHandler;
|
||||
@@ -661,6 +666,9 @@ namespace AlibabaCloud
|
||||
CreateUserGroupOutcome createUserGroup(const Model::CreateUserGroupRequest &request)const;
|
||||
void createUserGroupAsync(const Model::CreateUserGroupRequest& request, const CreateUserGroupAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
CreateUserGroupOutcomeCallable createUserGroupCallable(const Model::CreateUserGroupRequest& request) const;
|
||||
DataInterpretationOutcome dataInterpretation(const Model::DataInterpretationRequest &request)const;
|
||||
void dataInterpretationAsync(const Model::DataInterpretationRequest& request, const DataInterpretationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DataInterpretationOutcomeCallable dataInterpretationCallable(const Model::DataInterpretationRequest& request) const;
|
||||
DataSetBloodOutcome dataSetBlood(const Model::DataSetBloodRequest &request)const;
|
||||
void dataSetBloodAsync(const Model::DataSetBloodRequest& request, const DataSetBloodAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DataSetBloodOutcomeCallable dataSetBloodCallable(const Model::DataSetBloodRequest& request) const;
|
||||
|
||||
@@ -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_QUICKBI_PUBLIC_MODEL_DATAINTERPRETATIONREQUEST_H_
|
||||
#define ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_DATAINTERPRETATIONREQUEST_H_
|
||||
|
||||
#include <alibabacloud/quickbi-public/Quickbi_publicExport.h>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace AlibabaCloud {
|
||||
namespace Quickbi_public {
|
||||
namespace Model {
|
||||
class ALIBABACLOUD_QUICKBI_PUBLIC_EXPORT DataInterpretationRequest : public RpcServiceRequest {
|
||||
public:
|
||||
DataInterpretationRequest();
|
||||
~DataInterpretationRequest();
|
||||
bool getPromptForceOverride() const;
|
||||
void setPromptForceOverride(bool promptForceOverride);
|
||||
std::string getData() const;
|
||||
void setData(const std::string &data);
|
||||
std::string getAccessPoint() const;
|
||||
void setAccessPoint(const std::string &accessPoint);
|
||||
std::string getUserQuestion() const;
|
||||
void setUserQuestion(const std::string &userQuestion);
|
||||
std::string getSignType() const;
|
||||
void setSignType(const std::string &signType);
|
||||
std::string getUserPrompt() const;
|
||||
void setUserPrompt(const std::string &userPrompt);
|
||||
std::string getModelCode() const;
|
||||
void setModelCode(const std::string &modelCode);
|
||||
|
||||
private:
|
||||
bool promptForceOverride_;
|
||||
std::string data_;
|
||||
std::string accessPoint_;
|
||||
std::string userQuestion_;
|
||||
std::string signType_;
|
||||
std::string userPrompt_;
|
||||
std::string modelCode_;
|
||||
};
|
||||
} // namespace Model
|
||||
} // namespace Quickbi_public
|
||||
} // namespace AlibabaCloud
|
||||
#endif // !ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_DATAINTERPRETATIONREQUEST_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_QUICKBI_PUBLIC_MODEL_DATAINTERPRETATIONRESULT_H_
|
||||
#define ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_DATAINTERPRETATIONRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/quickbi-public/Quickbi_publicExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Quickbi_public
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_QUICKBI_PUBLIC_EXPORT DataInterpretationResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
DataInterpretationResult();
|
||||
explicit DataInterpretationResult(const std::string &payload);
|
||||
~DataInterpretationResult();
|
||||
bool getSuccess()const;
|
||||
std::string getResult()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
bool success_;
|
||||
std::string result_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_QUICKBI_PUBLIC_MODEL_DATAINTERPRETATIONRESULT_H_
|
||||
@@ -58,6 +58,7 @@ namespace AlibabaCloud
|
||||
std::string refUid;
|
||||
std::string uid;
|
||||
std::string expression;
|
||||
std::string expressionV2;
|
||||
std::string dataType;
|
||||
std::string tableUniqueId;
|
||||
std::string granularity;
|
||||
@@ -69,6 +70,7 @@ namespace AlibabaCloud
|
||||
{
|
||||
std::string uid;
|
||||
std::string expression;
|
||||
std::string expressionV2;
|
||||
std::string dataType;
|
||||
std::string measureType;
|
||||
std::string tableUniqueId;
|
||||
|
||||
@@ -36,6 +36,8 @@ public:
|
||||
void setAccessPoint(const std::string &accessPoint);
|
||||
std::string getLlmCubes() const;
|
||||
void setLlmCubes(const std::string &llmCubes);
|
||||
std::string getCubeIds() const;
|
||||
void setCubeIds(const std::string &cubeIds);
|
||||
std::string getSignType() const;
|
||||
void setSignType(const std::string &signType);
|
||||
int getOperationType() const;
|
||||
@@ -49,6 +51,7 @@ private:
|
||||
std::string llmCubeThemes_;
|
||||
std::string accessPoint_;
|
||||
std::string llmCubes_;
|
||||
std::string cubeIds_;
|
||||
std::string signType_;
|
||||
int operationType_;
|
||||
std::string expireDay_;
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace AlibabaCloud
|
||||
{
|
||||
struct MetaTypeItem
|
||||
{
|
||||
std::string type;
|
||||
std::string value;
|
||||
std::string key;
|
||||
};
|
||||
|
||||
@@ -771,6 +771,42 @@ Quickbi_publicClient::CreateUserGroupOutcomeCallable Quickbi_publicClient::creat
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Quickbi_publicClient::DataInterpretationOutcome Quickbi_publicClient::dataInterpretation(const DataInterpretationRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DataInterpretationOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DataInterpretationOutcome(DataInterpretationResult(outcome.result()));
|
||||
else
|
||||
return DataInterpretationOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void Quickbi_publicClient::dataInterpretationAsync(const DataInterpretationRequest& request, const DataInterpretationAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, dataInterpretation(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
Quickbi_publicClient::DataInterpretationOutcomeCallable Quickbi_publicClient::dataInterpretationCallable(const DataInterpretationRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DataInterpretationOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->dataInterpretation(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
Quickbi_publicClient::DataSetBloodOutcome Quickbi_publicClient::dataSetBlood(const DataSetBloodRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
|
||||
90
quickbi-public/src/model/DataInterpretationRequest.cc
Normal file
90
quickbi-public/src/model/DataInterpretationRequest.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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/quickbi-public/model/DataInterpretationRequest.h>
|
||||
|
||||
using AlibabaCloud::Quickbi_public::Model::DataInterpretationRequest;
|
||||
|
||||
DataInterpretationRequest::DataInterpretationRequest()
|
||||
: RpcServiceRequest("quickbi-public", "2022-01-01", "DataInterpretation") {
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DataInterpretationRequest::~DataInterpretationRequest() {}
|
||||
|
||||
bool DataInterpretationRequest::getPromptForceOverride() const {
|
||||
return promptForceOverride_;
|
||||
}
|
||||
|
||||
void DataInterpretationRequest::setPromptForceOverride(bool promptForceOverride) {
|
||||
promptForceOverride_ = promptForceOverride;
|
||||
setParameter(std::string("PromptForceOverride"), promptForceOverride ? "true" : "false");
|
||||
}
|
||||
|
||||
std::string DataInterpretationRequest::getData() const {
|
||||
return data_;
|
||||
}
|
||||
|
||||
void DataInterpretationRequest::setData(const std::string &data) {
|
||||
data_ = data;
|
||||
setParameter(std::string("Data"), data);
|
||||
}
|
||||
|
||||
std::string DataInterpretationRequest::getAccessPoint() const {
|
||||
return accessPoint_;
|
||||
}
|
||||
|
||||
void DataInterpretationRequest::setAccessPoint(const std::string &accessPoint) {
|
||||
accessPoint_ = accessPoint;
|
||||
setParameter(std::string("AccessPoint"), accessPoint);
|
||||
}
|
||||
|
||||
std::string DataInterpretationRequest::getUserQuestion() const {
|
||||
return userQuestion_;
|
||||
}
|
||||
|
||||
void DataInterpretationRequest::setUserQuestion(const std::string &userQuestion) {
|
||||
userQuestion_ = userQuestion;
|
||||
setParameter(std::string("UserQuestion"), userQuestion);
|
||||
}
|
||||
|
||||
std::string DataInterpretationRequest::getSignType() const {
|
||||
return signType_;
|
||||
}
|
||||
|
||||
void DataInterpretationRequest::setSignType(const std::string &signType) {
|
||||
signType_ = signType;
|
||||
setParameter(std::string("SignType"), signType);
|
||||
}
|
||||
|
||||
std::string DataInterpretationRequest::getUserPrompt() const {
|
||||
return userPrompt_;
|
||||
}
|
||||
|
||||
void DataInterpretationRequest::setUserPrompt(const std::string &userPrompt) {
|
||||
userPrompt_ = userPrompt;
|
||||
setParameter(std::string("UserPrompt"), userPrompt);
|
||||
}
|
||||
|
||||
std::string DataInterpretationRequest::getModelCode() const {
|
||||
return modelCode_;
|
||||
}
|
||||
|
||||
void DataInterpretationRequest::setModelCode(const std::string &modelCode) {
|
||||
modelCode_ = modelCode;
|
||||
setParameter(std::string("ModelCode"), modelCode);
|
||||
}
|
||||
|
||||
58
quickbi-public/src/model/DataInterpretationResult.cc
Normal file
58
quickbi-public/src/model/DataInterpretationResult.cc
Normal file
@@ -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/quickbi-public/model/DataInterpretationResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Quickbi_public;
|
||||
using namespace AlibabaCloud::Quickbi_public::Model;
|
||||
|
||||
DataInterpretationResult::DataInterpretationResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DataInterpretationResult::DataInterpretationResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DataInterpretationResult::~DataInterpretationResult()
|
||||
{}
|
||||
|
||||
void DataInterpretationResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
if(!value["Result"].isNull())
|
||||
result_ = value["Result"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
bool DataInterpretationResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
std::string DataInterpretationResult::getResult()const
|
||||
{
|
||||
return result_;
|
||||
}
|
||||
|
||||
@@ -114,6 +114,8 @@ void QueryDatasetInfoResult::parse(const std::string &payload)
|
||||
dimensionListItemObject.tableUniqueId = resultNodeDimensionListDimensionListItem["TableUniqueId"].asString();
|
||||
if(!resultNodeDimensionListDimensionListItem["Uid"].isNull())
|
||||
dimensionListItemObject.uid = resultNodeDimensionListDimensionListItem["Uid"].asString();
|
||||
if(!resultNodeDimensionListDimensionListItem["ExpressionV2"].isNull())
|
||||
dimensionListItemObject.expressionV2 = resultNodeDimensionListDimensionListItem["ExpressionV2"].asString();
|
||||
result_.dimensionList.push_back(dimensionListItemObject);
|
||||
}
|
||||
auto allMeasureListNode = resultNode["MeasureList"]["MeasureListItem"];
|
||||
@@ -136,6 +138,8 @@ void QueryDatasetInfoResult::parse(const std::string &payload)
|
||||
measureListItemObject.tableUniqueId = resultNodeMeasureListMeasureListItem["TableUniqueId"].asString();
|
||||
if(!resultNodeMeasureListMeasureListItem["Uid"].isNull())
|
||||
measureListItemObject.uid = resultNodeMeasureListMeasureListItem["Uid"].asString();
|
||||
if(!resultNodeMeasureListMeasureListItem["ExpressionV2"].isNull())
|
||||
measureListItemObject.expressionV2 = resultNodeMeasureListMeasureListItem["ExpressionV2"].asString();
|
||||
result_.measureList.push_back(measureListItemObject);
|
||||
}
|
||||
auto directoryNode = resultNode["Directory"];
|
||||
|
||||
@@ -52,6 +52,15 @@ void SmartqAuthorizeRequest::setLlmCubes(const std::string &llmCubes) {
|
||||
setParameter(std::string("LlmCubes"), llmCubes);
|
||||
}
|
||||
|
||||
std::string SmartqAuthorizeRequest::getCubeIds() const {
|
||||
return cubeIds_;
|
||||
}
|
||||
|
||||
void SmartqAuthorizeRequest::setCubeIds(const std::string &cubeIds) {
|
||||
cubeIds_ = cubeIds;
|
||||
setParameter(std::string("CubeIds"), cubeIds);
|
||||
}
|
||||
|
||||
std::string SmartqAuthorizeRequest::getSignType() const {
|
||||
return signType_;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ void SmartqQueryAbilityResult::parse(const std::string &payload)
|
||||
metaTypeItemObject.key = resultNodeMetaTypeMetaTypeItem["Key"].asString();
|
||||
if(!resultNodeMetaTypeMetaTypeItem["Value"].isNull())
|
||||
metaTypeItemObject.value = resultNodeMetaTypeMetaTypeItem["Value"].asString();
|
||||
if(!resultNodeMetaTypeMetaTypeItem["Type"].isNull())
|
||||
metaTypeItemObject.type = resultNodeMetaTypeMetaTypeItem["Type"].asString();
|
||||
result_.metaType.push_back(metaTypeItemObject);
|
||||
}
|
||||
auto allValuesNode = resultNode["Values"]["ValuesItem"];
|
||||
|
||||
Reference in New Issue
Block a user