Add a API QueryDeviceProvisioning to support query provisioning info for device.

This commit is contained in:
sdk-team
2023-03-02 12:38:16 +00:00
parent da19881477
commit f47daab733
12 changed files with 342 additions and 127 deletions

View File

@@ -542,6 +542,8 @@
#include "model/QueryDevicePropertyDataResult.h"
#include "model/QueryDevicePropertyStatusRequest.h"
#include "model/QueryDevicePropertyStatusResult.h"
#include "model/QueryDeviceProvisioningRequest.h"
#include "model/QueryDeviceProvisioningResult.h"
#include "model/QueryDeviceServiceDataRequest.h"
#include "model/QueryDeviceServiceDataResult.h"
#include "model/QueryDeviceSpeechRequest.h"
@@ -1603,6 +1605,9 @@ namespace AlibabaCloud
typedef Outcome<Error, Model::QueryDevicePropertyStatusResult> QueryDevicePropertyStatusOutcome;
typedef std::future<QueryDevicePropertyStatusOutcome> QueryDevicePropertyStatusOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::QueryDevicePropertyStatusRequest&, const QueryDevicePropertyStatusOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryDevicePropertyStatusAsyncHandler;
typedef Outcome<Error, Model::QueryDeviceProvisioningResult> QueryDeviceProvisioningOutcome;
typedef std::future<QueryDeviceProvisioningOutcome> QueryDeviceProvisioningOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::QueryDeviceProvisioningRequest&, const QueryDeviceProvisioningOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryDeviceProvisioningAsyncHandler;
typedef Outcome<Error, Model::QueryDeviceServiceDataResult> QueryDeviceServiceDataOutcome;
typedef std::future<QueryDeviceServiceDataOutcome> QueryDeviceServiceDataOutcomeCallable;
typedef std::function<void(const IotClient*, const Model::QueryDeviceServiceDataRequest&, const QueryDeviceServiceDataOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> QueryDeviceServiceDataAsyncHandler;
@@ -2796,6 +2801,9 @@ namespace AlibabaCloud
QueryDevicePropertyStatusOutcome queryDevicePropertyStatus(const Model::QueryDevicePropertyStatusRequest &request)const;
void queryDevicePropertyStatusAsync(const Model::QueryDevicePropertyStatusRequest& request, const QueryDevicePropertyStatusAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryDevicePropertyStatusOutcomeCallable queryDevicePropertyStatusCallable(const Model::QueryDevicePropertyStatusRequest& request) const;
QueryDeviceProvisioningOutcome queryDeviceProvisioning(const Model::QueryDeviceProvisioningRequest &request)const;
void queryDeviceProvisioningAsync(const Model::QueryDeviceProvisioningRequest& request, const QueryDeviceProvisioningAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryDeviceProvisioningOutcomeCallable queryDeviceProvisioningCallable(const Model::QueryDeviceProvisioningRequest& request) const;
QueryDeviceServiceDataOutcome queryDeviceServiceData(const Model::QueryDeviceServiceDataRequest &request)const;
void queryDeviceServiceDataAsync(const Model::QueryDeviceServiceDataRequest& request, const QueryDeviceServiceDataAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
QueryDeviceServiceDataOutcomeCallable queryDeviceServiceDataCallable(const Model::QueryDeviceServiceDataRequest& request) const;

View File

@@ -41,8 +41,6 @@ namespace AlibabaCloud
void setFileConfig(const std::string& fileConfig);
std::string getIotInstanceId()const;
void setIotInstanceId(const std::string& iotInstanceId);
std::string getContext()const;
void setContext(const std::string& context);
std::string getTableName()const;
void setTableName(const std::string& tableName);
long getEndTime()const;
@@ -58,7 +56,6 @@ namespace AlibabaCloud
long startTime_;
std::string fileConfig_;
std::string iotInstanceId_;
std::string context_;
std::string tableName_;
long endTime_;
std::string downloadDataType_;

View File

@@ -34,51 +34,11 @@ namespace AlibabaCloud
public:
struct Data
{
struct QuerySetting
{
struct SelectedHeadersItem
{
std::string geoClass;
std::string dimDateClass;
std::string alias;
std::string timeClass;
std::string fieldName;
std::string fieldType;
};
struct AstExprItem
{
std::string expr;
std::string exprType;
};
std::vector<AstExprItem> astExpr;
std::vector<SelectedHeadersItem> selectedHeaders;
};
struct HeaderItem
{
std::string geoClass;
std::string dimDateClass;
std::string alias;
std::string typeClass;
std::string timeClass;
std::string dataPrecision;
std::string fieldName;
std::string fieldType;
};
int status;
bool asyncExecute;
long endTime;
int pageSize;
std::string csvUrl;
long beginTime;
std::string csvFileName;
std::string datasetId;
long totalCount;
std::vector<HeaderItem> header;
std::string longJobId;
std::string resultDataInString;
int pageNo;
QuerySetting querySetting;
int previewSize;
std::string csvUrl;
std::string csvFileName;
};

View File

@@ -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_IOT_MODEL_QUERYDEVICEPROVISIONINGREQUEST_H_
#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEPROVISIONINGREQUEST_H_
#include <string>
#include <vector>
#include <alibabacloud/core/RpcServiceRequest.h>
#include <alibabacloud/iot/IotExport.h>
namespace AlibabaCloud
{
namespace Iot
{
namespace Model
{
class ALIBABACLOUD_IOT_EXPORT QueryDeviceProvisioningRequest : public RpcServiceRequest
{
public:
QueryDeviceProvisioningRequest();
~QueryDeviceProvisioningRequest();
std::string getProductKey()const;
void setProductKey(const std::string& productKey);
std::string getApiProduct()const;
void setApiProduct(const std::string& apiProduct);
std::string getApiRevision()const;
void setApiRevision(const std::string& apiRevision);
std::string getDeviceName()const;
void setDeviceName(const std::string& deviceName);
private:
std::string productKey_;
std::string apiProduct_;
std::string apiRevision_;
std::string deviceName_;
};
}
}
}
#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEPROVISIONINGREQUEST_H_

View File

@@ -0,0 +1,69 @@
/*
* 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_IOT_MODEL_QUERYDEVICEPROVISIONINGRESULT_H_
#define ALIBABACLOUD_IOT_MODEL_QUERYDEVICEPROVISIONINGRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/iot/IotExport.h>
namespace AlibabaCloud
{
namespace Iot
{
namespace Model
{
class ALIBABACLOUD_IOT_EXPORT QueryDeviceProvisioningResult : public ServiceResult
{
public:
struct Data
{
std::string targetRegion;
long gmtCreate;
std::string targetIotInstanceId;
std::string aliyunUid;
long gmtModified;
std::string sourceIotInstanceId;
std::string sourceRegion;
std::string productKey;
std::string deviceName;
};
QueryDeviceProvisioningResult();
explicit QueryDeviceProvisioningResult(const std::string &payload);
~QueryDeviceProvisioningResult();
Data getData()const;
std::string getErrorMessage()const;
std::string getCode()const;
bool getSuccess()const;
protected:
void parse(const std::string &payload);
private:
Data data_;
std::string errorMessage_;
std::string code_;
bool success_;
};
}
}
}
#endif // !ALIBABACLOUD_IOT_MODEL_QUERYDEVICEPROVISIONINGRESULT_H_